Bundler找不到耙子,但似乎已安装 [英] Bundler cannot find rake but it seems installed
问题描述
我在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':无法在任何源中找到rake-10.3.1(Bundler :: GemNotFound)$ / $ b / from /Users/dru.solis/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler- 1.6.2 / lib / bundler / spec_set.rb:85:在`map!'中
来自/Users/dru.solis/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler- 1.6.2 / lib / bundler / spec_set.rb:85:在`materialize'
from /Users/dru.solis/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.6 .2 / lib / bundler / definition.rb:133:来自/Users/dru.solis/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.6的`specs'
。 2 / lib / bundler / definition.rb:178:来自/Users/dru.solis/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.6.2的`specs_for'
/lib/bundler/definition.rb:167:in`requested_specs'
from /Users/dru.solis/.rvm/gems/ruby-1.9.3-p392@global/gems/bundl er-1.6.2 / lib / bundler / environment.rb:18:在`requested_specs'
from /Users/dru.solis/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler -1.6.2 / lib / bundler / runtime.rb:13:在`setup'中
从/Users/dru.solis/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler- 1.6.2 / lib / bundler.rb:120:在`setup'中
来自/Users/dru.solis/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.6.2
- 摧毁了Gemfile.lock并尝试了一个
bundle install
。这重新安装了宝石,并清楚地显示rake-10.3.1被安装,但是当我运行rspec时,它仍然表示它找不到rake。 - 手动尝试使用
gem install rake -v 10.3.1
这也表明已安装rake-10.3.1,但rspec命令仍会引发相同的错误。
- 明确指定的rake 10.3.1在Gemfile中,剔除Gemfile.lock和
bundle install
- 卸载rake(找到所有版本)<$ c $使用
gem install rake -v 10.3.1
- 卸载rake 并重新安装rake。我使用并重新安装它的版本与
rvm uninstall ruby-1.9.3-p392
然后rvm install ruby-1.9.3-p392
。
- 将捆绑包降级至1.6.1
- 卸载并重新安装捆绑包
rvm implode
并重新安装rvm
- 明确指定的rake 10.3.1在Gemfile中,剔除Gemfile.lock和
这些都不能解决问题。 p>
bundle show
说:rake-10.3.1被安装。
包含的宝石:
* 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-任务(0.0.2)
* outbound_client(0.0.5)
* pry(0.9.12.6)
* rabbitmq_http_api_cl (1.1.1)
* 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
总计0
drwxrwxr-x 10 dru.solis员工340 5月9日23:22。
drwxrwxr-x 11 dru.solis staff 374 5月9日23:16 ..
drwxr-xr-x 18 dru.solis staff 612 5月9日23:17 bundler-1.6.2
drwxr -xr-x 8 dru.solis staff 272 5月9日23:16 bundler-unload-1.0.2
drwxr-xr-x 12 dru.solis staff 408 5月9日23:16 executable-hooks-1.3.1
drwxr-xr-x 13 dru.solis工作人员442 5月9日23:16 gem-wrappers-1.2.4
drwxr-xr-x 16 dru.solis工作人员544 5月9日23:20 rake-10.3。 1
drwxr-xr-x 3 dru.solis工作人员102 5月9日23:16 rdoc-3.9.5
drwxr-xr-x 13 dru.solis工作人员442 5月9日23:16 rubygems-bundler- 1.4.3
drwxr-xr-x 7 dru.solis staff 238 5月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/ 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目录
- 删除我的项目中的vendor目录
- 删除Gemfile.lock
bundle install
之后它开始工作,没有抱怨没有发现耙子。疯子。啊。希望这可以帮助其他人,如果他们遇到同样的问题。
I am having some struggles with bundler and rake. According to the error message, bundler can't find rake-10.3.1. Here's the thing, everything I've done seems to indicate that rake-10.3.1 is installed. I've been floating in the google-sphere for days without finding a solution that resolves this issue for me.
I'm on Mac OSX 10.8.5. Ruby version is 1.9.3-p392.
Error:
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
Here are things I've done:
- Blasted away the Gemfile.lock and tried a
bundle install
. This reinstalls gems and clearly shows rake-10.3.1 being installed but when I run rspec it still says it can't find rake. - Manually try to install gem with
gem install rake -v 10.3.1
which also indicates that rake-10.3.1 is installed but rspec command still throws the same error. - Explicitly specified rake 10.3.1 in the Gemfile, blasted away Gemfile.lock and
bundle install
- Uninstall rake (all versions found)
gem uninstall rake
and reinstall rake usinggem install rake -v 10.3.1
- Uninstalled the version of ruby I was using and reinstalled it with
rvm uninstall ruby-1.9.3-p392
and thenrvm install ruby-1.9.3-p392
. - Downgrade bundler to 1.6.1
- Uninstall and reinstall bundler
rvm implode
and reinstall rvm
None of these fixed the issue.
bundle show
says that rake-10.3.1 is installed.
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)
I've checked the .rvm directory for the presence of the rake-10.3.1 gem and it's there.
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
Output of 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
So, I finally managed to get this error to go away. I started thinking it was some weird permission issue.
To solve this problem, I did the following:
- Open the Disk Utility, Applications/Utilities/Disk Utility
- Repair Permissions
- Remove the .bundle directory in my project
- Remove the vendor directory in my project
- Remove the Gemfile.lock
bundle install
After that it started working without complaining about not finding rake. Crazy, man. Ugh. Hopefully this helps other folks if they run into the same issue.
这篇关于Bundler找不到耙子,但似乎已安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!