我正在制作一个 gem,并在我的存储库中添加了一个 Gemfile。当我跑
$ rake test
一切顺利。我自己编写的test
命令,它只是执行我的测试文件夹中的所有测试。所以,像这样
ruby -Ilib *_test.rb
但是,当我在rake test
命令前面加上前缀时bundle exec
,我开始从我使用的唯一 gem 中收到错误,faraday
. 你知道可能是什么问题吗?(我正在使用 rbenv)
所有的错误都是这样的:
Flickrie::Error: Flickrie::Error
/Users/jstojanovski/Projects/flickrie/lib/flickrie/client.rb:37:in `on_complete'
/Users/jstojanovski/.rbenv/versions/1.9.2-p318/lib/ruby/gems/1.9.1/gems/faraday-0.7.6/lib/faraday/response.rb:9:in `block in call'
/Users/jstojanovski/.rbenv/versions/1.9.2-p318/lib/ruby/gems/1.9.1/gems/faraday-0.7.6/lib/faraday/response.rb:62:in `on_complete'
/Users/jstojanovski/.rbenv/versions/1.9.2-p318/lib/ruby/gems/1.9.1/gems/faraday-0.7.6/lib/faraday/response.rb:8:in `call'
/Users/jstojanovski/.rbenv/versions/1.9.2-p318/lib/ruby/gems/1.9.1/gems/faraday-0.7.6/lib/faraday/response.rb:8:in `call'
/Users/jstojanovski/.rbenv/versions/1.9.2-p318/lib/ruby/gems/1.9.1/gems/faraday-0.7.6/lib/faraday/response.rb:8:in `call'
/Users/jstojanovski/.rbenv/versions/1.9.2-p318/lib/ruby/gems/1.9.1/gems/faraday-0.7.6/lib/faraday/request/json.rb:32:in `call'
/Users/jstojanovski/.rbenv/versions/1.9.2-p318/lib/ruby/gems/1.9.1/gems/faraday-0.7.6/lib/faraday/request/url_encoded.rb:14:in `call'
/Users/jstojanovski/.rbenv/versions/1.9.2-p318/lib/ruby/gems/1.9.1/gems/faraday-0.7.6/lib/faraday/connection.rb:210:in `run_request'
/Users/jstojanovski/.rbenv/versions/1.9.2-p318/lib/ruby/gems/1.9.1/gems/faraday-0.7.6/lib/faraday/connection.rb:93:in `get'
/Users/jstojanovski/Projects/flickrie/lib/flickrie/client.rb:44:in `get'
/Users/jstojanovski/Projects/flickrie/lib/flickrie/client.rb:85:in `get_licenses'
/Users/jstojanovski/Projects/flickrie/lib/flickrie.rb:72:in `get_licenses'
/Users/jstojanovski/Projects/flickrie/test/license_test.rb:22:in `test_get_licenses'
这Flickrie::Error
只是我在 GET 请求期间引发异常时提出的问题(我在 Flickr API 上发出 GET 请求)。
当我rake test
使用不同的 ruby 版本(不同于 1.9.3)运行正常时,也会发生这些错误。