2

I am having a problem using the 'Typhoeus Gem'. I have it installed properly (It shows up as installed when the command "gem list"). Below is the code I am running:

def test
   response = Typhoeus.get("http://google.com")
   puts response.code

end
   puts test

Below is the error code I am getting when I try and run the code:

 C:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': 193: %1 is not a valid Win32 application.   - C:/Ruby21-x64/lib/ruby/2.1.0/x64-mingw32/openssl.so (LoadError)
    from C:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from C:/Ruby21-x64/lib/ruby/2.1.0/openssl.rb:17:in `<top (required)>'
    from C:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from C:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from C:/Ruby21-x64/lib/ruby/2.1.0/net/https.rb:22:in `<top (required)>'
    from C:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from C:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/oauth-0.4.7/lib/oauth/consumer.rb:2:in `<top (required)>'
    from C:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from C:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/oauth-0.4.7/lib/oauth/client/helper.rb:2:in `<top (required)>'
    from C:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from C:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/oauth-0.4.7/lib/oauth.rb:10:in `<top (required)>'
    from C:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from C:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/etsy-0.3.0/lib/Etsy.rb:5:in `<top (required)>'
    from C:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `require'
    from C:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
    from C:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
    from ./sandbox_GET.rb:10:in `<main>'

I have tried numerous solutions which I found on other websites but none of them seem to be working for me. I am running Windows 7 X64. I have read some where that there has been an issue with this problem on my OS config but I have failed to find any work around.

Any help would be greatly appreciated as I am completely lost to be honest. :)

Further Details

When I try "gem install openssl"

I get this error message

  ERROR:  Loading command: install (LoadError)
    193: %1 is not a valid Win32 application.   - C:/Ruby21-x64/lib/ruby/2.1.0/x64-mingw32/openssl.so
ERROR:  While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass

I am still a complete beginner and I could be making a very simple mistake but I am completely lost at the moment.

----------------------UPDATE-----------------------------------

After running "gem help commands" I get the error message

   ERROR:  Loading command: build (LoadError) 193: %1 is not a valid Win32 application.   - C:/Ruby21-x64/lib/ruby/2.1.0/x64-mingw32/openssl.so
   ERROR:  Loading command: cert (LoadError) 193: %1 is not a valid Win32 application.   - C:/Ruby21-x64/lib/ruby/2.1.0/x64-mingw32/openssl.so
   ERROR:  Loading command: check (LoadError)
    193: %1 is not a valid Win32 application.   - C:/Ruby21-x64/lib/ruby/2.1.0/x64-mingw32/openssl.so
   ERROR:  Loading command: generate_index (LoadError)
    193: %1 is not a valid Win32 application.   - C:/Ruby21-x64/lib/ruby/2.1.0/x64-mingw32/openssl.so
   ERROR:  Loading command: install (LoadError)
    193: %1 is not a valid Win32 application.   - C:/Ruby21-x64/lib/ruby/2.1.0/x64-mingw32/openssl.so
   ERROR:  Loading command: pristine (LoadError)
    193: %1 is not a valid Win32 application.   - C:/Ruby21-x64/lib/ruby/2.1.0/x64-mingw32/openssl.so
   ERROR:  Loading command: push (LoadError)
    193: %1 is not a valid Win32 application.   - C:/Ruby21-x64/lib/ruby/2.1.0/x64-mingw32/openssl.so
   ERROR:  Loading command: server (LoadError)
    193: %1 is not a valid Win32 application.   - C:/Ruby21-x64/lib/ruby/2.1.0/x64-mingw32/digest/md5.so
   ERROR:  Loading command: specification (LoadError)
    193: %1 is not a valid Win32 application.   - C:/Ruby21-x64/lib/ruby/2.1.0/x64-mingw32/openssl.so
   ERROR:  Loading command: unpack (LoadError)
    193: %1 is not a valid Win32 application.   - C:/Ruby21-x64/lib/ruby/2.1.0/x64-mingw32/openssl.so
   ERROR:  Loading command: update (LoadError)
    193: %1 is not a valid Win32 application.   - C:/Ruby21-x64/lib/ruby/2.1.0/x64-mingw32/openssl.so
   GEM commands are:

build             [No command found for build]
cert              [No command found for cert]
check             [No command found for check]
cleanup           Clean up old versions of installed gems
contents          Display the contents of the installed gems
dependency        Show the dependencies of an installed gem
environment       Display information about the RubyGems environment
fetch             Download a gem and place it in the current directory
generate_index    [No command found for generate_index]
help              Provide help on the 'gem' command
install           [No command found for install]
list              Display local gems whose name starts with STRING
lock              Generate a lockdown list of gems
mirror            Mirror all gem files (requires rubygems-mirror)
outdated          Display all gems that need updates
owner             Manage gem owners of a gem on the push server
pristine          [No command found for pristine]
push              [No command found for push]
query             Query gem information in local or remote repositories
rdoc              Generates RDoc for pre-installed gems
search            Display remote gems whose name contains STRING
server            [No command found for server]
sources           Manage the sources and cache file RubyGems uses to search
                  for gems
specification     [No command found for specification]
stale             List gems along with access times
uninstall         Uninstall gems from the local repository
unpack            [No command found for unpack]
update            [No command found for update]
which             Find the location of a library file you can require
yank              Remove a pushed gem from the index

 For help on a particular command, use 'gem help COMMAND'.

---------------------------UPDATE--------------------------------

I think I might have isolated the issue down to the devkit and the Curb gem

when I run "gem install curb" I get

ERROR:  Error installing curb:
    The 'curb' native gem requires installed build tools.

 Please update your PATH to include build tools or download the DevKit
 from 'http://rubyinstaller.org/downloads' and follow the instructions
 at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

Going to have a look at the devkit and see if that is the problem. :)

  • 2
    possible duplicate of [193: %1 is not a valid Win32 application error with Ruby (1.9.3) on Rails(3.2.3) with MySQL(5.5) on Windows 7](http://stackoverflow.com/questions/10468118/193-1-is-not-a-valid-win32-application-error-with-ruby-1-9-3-on-rails3-2-3) – MarsAtomic Aug 16 '15 at 20:58
  • @MarsAtomic Thanks for the reply yes I have tried following the steps in that Answer but still no success seems to be a problem with openssl gem as I cant install the "gem openssl" – Michael O Meara Aug 16 '15 at 21:04
  • Fair enough. Now your question has to be "why can't I install openssl." – MarsAtomic Aug 16 '15 at 21:07
  • So... are you sre you're having problems with "gem openssl" or are you having problems connecting to RubyGems.org via open SSL? I can't seem to find reference to any open SSL gem at all -- open SSL is a module for your Ruby installation. – MarsAtomic Aug 16 '15 at 21:47
  • @MarsAtomic Thanks for the help. Yes I think you could be right its not just with the openssl gem I tried "gem install rubygems-update-2.2.3.gem" and I got a similar error message. I think it could be actually be a problem with my ssl certs I tried updating the ssl certs but not sure if I am doing it right. Thanks again for the interest. – Michael O Meara Aug 16 '15 at 21:56
  • Did you change anything, or try to change anything with the installation yet? Also can you tell me what anti-virus you may be using and anything that might plug into `LoadLibrary` behavior? (see [RubyInstaller issue #102](https://github.com/oneclick/rubyinstaller/issues/102)). That aside Typhoeus is a non-trivial thing to get working on Windows, but this is actually not related to Typhoeus. – Azolo Aug 16 '15 at 22:30
  • @Azolo I think you could be right..... I have tried running some ruby code that I know for definite should work which is unrelated to Typhoeus and it has come up with the same error message. I think it might be related to some SSL Cert files that I might have been messing with is there anyway I can reinstall my Ruby installation and add the openssl as a extension? Thanks again – Michael O Meara Aug 16 '15 at 22:38
  • @Azolo I don't use any antivirus at the moment as for the LoadLibary nothing that I am aware of – Michael O Meara Aug 16 '15 at 22:45
  • We ship the compiled `OpenSSL` binaries required for the stdlib OpenSSL. Plus there's no `openssl` gem to install from rubygems. Try running `gem help commands` and `gem ins json` and let me know what happens. (Update your question) – Azolo Aug 16 '15 at 22:49
  • I have update the question above with the results of running the "gem help commands" I got similier error messages when running "gem ins json" I think it might be best if I uninstall ruby and reinstall a fresh version? – Michael O Meara Aug 16 '15 at 23:04
  • Try it! The worst that could happen is it doesn't work. Something is messing with your loading of OpenSSL though. – Azolo Aug 16 '15 at 23:20
  • Ok I will try that if I reinstall ruby will that mean I will have to install all my Gems again? – Michael O Meara Aug 16 '15 at 23:36
  • Yes, you'll have reinstall all your gems – Azolo Aug 16 '15 at 23:43
  • @Azolo I think my issue might be related to this https://github.com/oneclick/rubyinstaller/issues/276 I think you had an input on that problem as well. How do you create a guardfile? Thanks – Michael O Meara Aug 17 '15 at 22:30
  • I'm actually pretty sure that isn't related. But I do think this is enough of a problem that you should open up a ticket on the RubyInstaller project so we can troubleshoot it there. It's pretty baffling. – Azolo Aug 18 '15 at 02:25
  • Ok Is there any work around I could use as I am really stuck on my project now as Ruby seems like the feature I need does not work on my config? – Michael O Meara Aug 29 '15 at 19:50

0 Answers0