2

我在使用“Typhoeus Gem”时遇到问题。我已经正确安装了它(当命令“gem list”时它显示为已安装)。下面是我正在运行的代码:

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

end
   puts test

以下是我尝试运行代码时收到的错误代码:

 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>'

我尝试了许多在其他网站上找到的解决方案,但似乎没有一个对我有用。我正在运行 Windows 7 X64。我已经阅读了一些关于我的操作系统配置存在此问题的问题,但我找不到任何解决方法。

任何帮助将不胜感激,因为老实说我完全迷失了。:)

更多详细信息

当我尝试“gem install openssl”

我收到此错误消息

  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

我仍然是一个完整的初学者,我可能会犯一个非常简单的错误,但我现在完全迷失了。

- - - - - - - - - - - 更新 - - - - - - - - - - - - - - --------

运行“gem help commands”后,我收到错误消息

   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'.

- - - - - - - - - - - - - -更新 - - - - - - - - - - - ----------

我想我可能已经将问题隔离到 devkit 和 Curb gem

当我运行“宝石安装路边”时,我得到

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'

去看看devkit,看看是否是问题所在。:)

4

0 回答 0