我创建了一个名为的 gem kmdata
,它有一个可执行文件。bundle exec kmdata decot.7
从我的 gem 文件夹中运行时,一切正常。将 gem 释放到 rubygems 后,我跑了gem install kmdata
(在新窗口中)。然后我尝试运行kmdata decot.7
并得到以下信息
/Users/kyledecot/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:891:in `connect': undefined method `set_params' for #<OpenSSL::SSL::SSLContext:0x007fff31d59d18> (NoMethodError)
from /Users/kyledecot/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:862:in `do_start'
from /Users/kyledecot/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:851:in `start'
from /Users/kyledecot/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1367:in `request'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p247/gems/kmdata-0.0.3/lib/kmdata.rb:24:in `get'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p247/gems/kmdata-0.0.3/bin/kmdata:5:in `<top (required)>'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p247/bin/kmdata:23:in `load'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p247/bin/kmdata:23:in `<main>'
lib/kmdata.rb 中的行是
response = http.request(Net::HTTP::Get.new(path))
更新#1
仅在使用2.0
. 如果我在其中运行相同的命令,1.9.3
那么一切都会按预期工作。