Bundler找不到Rake但似乎安装了[英] Bundler cannot find rake but it seems installed

本文是小编为大家收集整理的关于Bundler找不到Rake但似乎安装了的处理方法,想解了Bundler找不到Rake但似乎安装了的问题怎么解决?Bundler找不到Rake但似乎安装了问题的解决办法?那么可以参考本文帮助大家快速定位并解决问题。

问题描述

我与捆绑和耙子有一些挣扎.根据错误消息,Bundler无法找到Rake-10.3.1.这是事情,我所做的一切似乎都表明Rake-10.3.1安装了.我一直漂浮在谷歌领域的日子,而不会找到一个解决这个问题的解决方案.

我在macosx 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

这里是我完成的事情:

  • 爆破了Gemfile.lock并尝试了a bundle install.这种重新安装宝石并清楚地显示了rake-10.3.1安装但是当我运行rspec时,它仍然说它找不到耙子.
  • 手动尝试使用gem install rake -v 10.3.1安装宝石,这也表示安装了rake-10.3.1但rspec命令仍会抛出相同的错误.
  • 在Gemfile中明确指定佣金10.3.1,爆破的偏远gemfile.lock和bundle install
  • 卸载rake(找到的所有版本)gem uninstall rake并使用gem install rake -v 10.3.1
  • 重新安装rake
  • 卸载了我使用的Ruby版本并用rvm uninstall ruby-1.9.3-p392重新安装它,然后重新安装它,然后重新安装它,然后重新安装它rvm install ruby-1.9.3-p392.
  • 降级Bundler 1.6.1
  • 卸载和重新安装Bundler
  • 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

推荐答案

所以,我终于设法才能离开这个错误.我开始认为这是一些奇怪的许可问题.

要解决这个问题,我做了以下内容:

  • 打开磁盘实用程序,应用程序/实用程序/磁盘实用程序
  • 修复权限
  • 删除我的项目中的.bundle目录
  • 删除我的项目中的供应商目录
  • 删除gemfile.lock
  • bundle install

之后,它开始工作而不会抱怨未发现耙子.疯子.啊.希望这有助于其他人,如果他们遇到同样的问题.

本文地址:https://www.itbaoku.cn/post/786797.html