我在捆绑和耙子方面遇到了一些困难。根据错误消息,bundler找不到rake-10.3.1。这就是事情,我所做的一切似乎表明安装了rake-10.3.1。我已经在google-sphere中漂浮了几天而没有找到解决方案来解决这个问题。
我在Mac OSX 10.8.5上。 Ruby版本是1.9.3-p392。
错误:
bundle exec rspec spec/bdr_pre_dev_spec.rb /Users/dru.solis/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.6.2/lib/bundler/spec_set.rb:92:in `materialize': Could not find rake-10.3.1 in any of the sources (Bundler::GemNotFound) from /Users/dru.solis/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.6.2/lib/bundler/spec_set.rb:85:in `map!' from /Users/dru.solis/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.6.2/lib/bundler/spec_set.rb:85:in `materialize' from /Users/dru.solis/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.6.2/lib/bundler/definition.rb:133:in `specs' from /Users/dru.solis/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.6.2/lib/bundler/definition.rb:178:in `specs_for' from /Users/dru.solis/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.6.2/lib/bundler/definition.rb:167:in `requested_specs' from /Users/dru.solis/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.6.2/lib/bundler/environment.rb:18:in `requested_specs' from /Users/dru.solis/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:13:in `setup' from /Users/dru.solis/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.6.2/lib/bundler.rb:120:in `setup' from /Users/dru.solis/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.6.2/lib/bundler/setup.rb:17
以下是我所做的事情:
bundle install
。这会重新安装宝石并清楚地显示正在安装rake-10.3.1但是当我运行rspec时它仍然说它找不到rake。gem install rake -v 10.3.1
安装gem,这也表示安装了rake-10.3.1但是rspec命令仍然会抛出相同的错误。bundle install
gem uninstall rake
并使用gem install rake -v 10.3.1
rvm uninstall ruby-1.9.3-p392
然后rvm install ruby-1.9.3-p392
重新安装。rvm implode
并重新安装rvm 这些都没有解决问题。
bundle show
说安装了rake-10.3.1。
Gems included by the bundle: * activemodel (3.2.18) * activesupport (3.2.18) * amq-protocol (1.9.2) * amqp (1.3.0) * awesome_print (1.2.0) * bertha-scheduler (1.1.9) * bertha_client (0.5.5) * builder (3.0.4) * bundler (1.6.2) * coderay (1.1.0) * config_client (0.3.2) * config_core (1.0.2) * dao_core (2.6.3) * diff-lcs (1.2.5) * effin_utf8 (1.0) * eventmachine (1.0.3) * faraday (0.8.9) * faraday_middleware (0.9.1) * hashie (2.0.5) * highline (1.6.21) * httparty (0.11.0) * i18n (0.6.9) * method_source (0.8.2) * multi_json (1.8.4) * multi_xml (0.5.5) * multipart-post (1.2.0) * mysql2 (0.3.15) * net-scp (1.2.1) * net-sftp (2.1.2) * net-ssh (2.9.0) * nexus (1.2.1) * opower-rake-tasks (0.0.2) * outbound_client (0.0.5) * pry (0.9.12.6) * rabbitmq_http_api_client (1.1.0) * rake (10.3.1) * rspec (2.14.1) * rspec-core (2.14.8) * rspec-expectations (2.14.5) * rspec-mocks (2.14.6) * sequel (4.10.0) * slop (3.5.0) * term-ansicolor (1.3.0) * thor (0.19.1) * tins (1.1.0) * tools_core (1.3.0) * utility_configs (1.0.4)
我已经检查了.rvm目录中是否存在rake-10.3.1 gem,它就在那里。
ls /Users/dru.solis/.rvm/gems/ruby-1.9.3-p392@global/gems total 0 drwxrwxr-x 10 dru.solis staff 340 May 9 23:22 . drwxrwxr-x 11 dru.solis staff 374 May 9 23:16 .. drwxr-xr-x 18 dru.solis staff 612 May 9 23:17 bundler-1.6.2 drwxr-xr-x 8 dru.solis staff 272 May 9 23:16 bundler-unload-1.0.2 drwxr-xr-x 12 dru.solis staff 408 May 9 23:16 executable-hooks-1.3.1 drwxr-xr-x 13 dru.solis staff 442 May 9 23:16 gem-wrappers-1.2.4 drwxr-xr-x 16 dru.solis staff 544 May 9 23:20 rake-10.3.1 drwxr-xr-x 3 dru.solis staff 102 May 9 23:16 rdoc-3.9.5 drwxr-xr-x 13 dru.solis staff 442 May 9 23:16 rubygems-bundler-1.4.3 drwxr-xr-x 7 dru.solis staff 238 May 9 23:17 rvm-1.11.3.9
rvm env
的输出:
export PATH="/Users/dru.solis/.rvm/gems/ruby-1.9.3-p392/bin:/Users/dru.solis/.rvm/gems/ruby-1.9.3-p392@global/bin:/Users/dru.solis/.rvm/rubies/ruby-1.9.3-p392/bin:$PATH" export GEM_HOME='/Users/dru.solis/.rvm/gems/ruby-1.9.3-p392' export GEM_PATH='/Users/dru.solis/.rvm/gems/ruby-1.9.3-p392:/Users/dru.solis/.rvm/gems/ruby-1.9.3-p392@global' export MY_RUBY_HOME='/Users/dru.solis/.rvm/rubies/ruby-1.9.3-p392' export IRBRC='/Users/dru.solis/.rvm/rubies/ruby-1.9.3-p392/.irbrc' unset MAGLEV_HOME unset RBXOPT
答案 0 :(得分:4)
所以,我终于设法让这个错误消失了。我开始认为这是一个奇怪的许可问题。
为了解决这个问题,我做了以下几点:
bundle install
之后,它开始工作,没有抱怨没有找到耙子。疯子。啊。希望如果遇到同样的问题,这可以帮助其他人。