У меня проблема с использованием "Typhoeus Gem". У меня он установлен правильно (он отображается как установленный при команде «список драгоценных камней»). Ниже приведен код, который я запускаю:
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. Я где-то читал, что в конфигурации моей ОС была проблема с этой проблемой, но мне не удалось найти обходной путь.
Любая помощь будет принята с благодарностью, так как я полностью потерян, если честно. :)
Более подробная информация
Когда я пытаюсь "установить драгоценный камень 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
Я все еще полный новичок, и я мог бы сделать очень простую ошибку, но в данный момент я полностью потерян.
----------------------ОБНОВИТЬ--------------------------- --------
После запуска «команд помощи драгоценных камней» я получаю сообщение об ошибке
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 install curb", я получаю
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 и посмотреть, не в этом ли проблема. :)
LoadLibrary
? (см. проблема RubyInstaller #102). Кроме того, Typhoeus — нетривиальная вещь для работы в Windows, но на самом деле это не связано с Typhoeus. - person Azolo   schedule 17.08.2015OpenSSL
двоичные файлы, необходимые для stdlib OpenSSL. Плюс нетopenssl
gem для установки из rubygems. Попробуйте запуститьgem help commands
иgem ins json
и дайте мне знать, что произойдет. (Обновите свой вопрос) - person Azolo   schedule 17.08.2015