32

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!

Bernhard Barker
  • 54,589
  • 14
  • 104
  • 138
rda3000
  • 1,410
  • 1
  • 18
  • 31

4 Answers4

80

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
mpapis
  • 52,729
  • 14
  • 121
  • 158
  • I got "Unrecognized command line argument(s): '. ' ( see: 'rvm usage' )" when I ran this command. – Zeiga Jul 13 '12 at 02:02
  • what version of RVM are you using? update it and it should work just fine. – mpapis Jul 13 '12 at 15:49
  • rvm 1.9.2, "You already have the latest version!" when I did "rvm get latest", thanks. – Zeiga Jul 16 '12 at 16:26
  • that's old one, you need to update with `rvm get head` or just run the installer `curl -L get.rvm.io | bash -s stable`, make sure to run once `rvm reload` after updating. – mpapis Jul 16 '12 at 16:45
  • thanks, but i am still getting this error after i upgraded to 1.14.5. – Zeiga Jul 16 '12 at 16:54
  • 4
    It should be `rvm env -- ruby-1.9.3-p194 > .powenv`. If you have a gemset then put `rvm env -- ruby-1.9.3-p194@gemset > .powenv ` – Nick Vanderbilt Jul 25 '12 at 06:42
6

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
Greg Benedict
  • 219
  • 2
  • 5
6

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

Cyril
  • 171
  • 1
  • 7
3

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!)

Jo P
  • 1,656
  • 21
  • 25