pow says: Bundler::GemNotFound: Could not find rake-0.9.2.2 in any of the sources

给你一囗甜甜゛ 提交于 2019-12-04 07:35:17

问题


I have a rails app that runs fine with rails s, but when I try to load it using pow I'm getting this error:

Bundler::GemNotFound: Could not find rake-0.9.2.2 in any of the sources
~/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.22/lib/bundler/spec_set.rb:88:in `block in materialize'
~/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.22/lib/bundler/spec_set.rb:82:in `map!'
~/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.22/lib/bundler/spec_set.rb:82:in `materialize'
....

Weird thing is, the .rvmrc file in this app specifies 1.9.3-p125:

which rake
.../.rvm/gems/ruby-1.9.3-p125/bin/rake

and here's what I see when I run bundle install:

Using rake (0.9.2.2) 

FWIW, pow works just fine with another non-rails project using 1.9.2 and a different gemset.

Thanks!


回答1:


I guess you updated RVM and run into this known issue: https://github.com/37signals/pow/issues/271

the easiest solution is to run it in project dir:

rvm env . > .powenv

OR:

cd /project/path # with .rvmrc
rvm env > .powenv



回答2:


I ran into this issue when I changed from .rvmrc to .ruby-version and .ruby-gemset files.

Change your .powrc file to be:

if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".ruby-version" ] && [ -f ".ruby-gemset" ]; then
  source "$rvm_path/scripts/rvm"
  rvm use `cat .ruby-version`@`cat .ruby-gemset`
fi



回答3:


If you are using RVM you have to add a file named ".powenv" at the root of your project as described here :

http://rvm.io/integration/pow




回答4:


I've been using this .powrc which nicely covers all bases:

if [ -f "$rvm_path/scripts/rvm" ]; then
  source "$rvm_path/scripts/rvm"

  if [ -f ".rvmrc" ]; then
    source ".rvmrc"
  fi

  if [ -f ".ruby-version" ]; then
    rvm use `cat .ruby-version`
  fi

  if [ -f ".ruby-gemset" ]; then
    rvm gemset use --create `cat .ruby-gemset`
  fi
fi

Taken from here https://gist.github.com/nbibler/5307941 (thanks nbibler!)



来源:https://stackoverflow.com/questions/10304405/pow-says-bundlergemnotfound-could-not-find-rake-0-9-2-2-in-any-of-the-source

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!