Bundler::GemNotFound: Could not find rake-0.9.2.2 in any of the sources #20

Closed
larryzhao opened this Issue Jun 27, 2012 · 10 comments

Projects

None yet

2 participants

@larryzhao

I encountered this error when I do the deployment.

I could see the rake-0.9.2.2 in the output of the bundle:install step and also if I run the command on the server manually it's working correctly.

It seems that capistrano is not using the rvm string in the deploy.rb.

I put all the information to https://gist.github.com/3005237. Please help.

Thanks a lot.

@mpapis
Member
mpapis commented Jun 27, 2012

are you using any other plugins?

ruby -e "puts Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb']"

the only thing that brought my attention is that the toruquebox settings could interfere with something ...

@larryzhao

@mpapis

No, I am not using other plugins, I ran your command and outputs nothing.

The torquebox settings are brought by gem torquebox-capistrano-support. I just disabled all the torquebox thing and tried again and it fails at bundle install with error: Gem::InstallError: paperclip requires Ruby version >= 1.9.2. I put the output into the gist with a new file without torquebox.

I am using jruby in Dev and Staging environment. Since the agent forwarding problem with jruby, I am using ruby-1.9.2 to trigger the capistrano deployment process, could it be the problem?

@mpapis
Member
mpapis commented Jun 27, 2012

it's cleanly loading rvm/capistrano properly as you can see in the last line of both lines.

you can check if bundler worked properly with:

before "deploy:assets:precompile", :dump_bundle_config
task :dump_bundle_config do
  run "cat #{release_path}/.bundle/config"
end

It has to point to /opt/app/deploy/entercamp/shared/bundle

@mpapis mpapis was assigned Jun 27, 2012
@larryzhao

@mpapis I re-enabled torquebox and dumped_bundle_config, the path is correct, but the error still exists.

Full output in the gist with name dump bundle config

@mpapis
Member
mpapis commented Jun 27, 2012

I think the issue might be that you are trying to use jruby which was compiled in 1.8 mode as default and switch it to 1.9 at runtime, I had one report earlier about similar problem.

Try to reinstall jruby with 1.9 as default, on server run:

rvm reinstall jruby-1.6.7 --1.9

also as a side note jruby-1.6.7.2 is available including important fixes (important enough to release new version where 1.6.7 was supposed to be the last release for 1.6 tree)

@larryzhao

Thanks a lot and also for the note.

I uninstalled jruby-1.6.7 and tried to install 1.6.7.2 with 1.9 as default: rvm install jruby-1.6.7.2 --1.9, but encountered errors in the installation process:

$ rvm install jruby-1.6.7.2 --1.9
jruby-1.6.7.2 - #fetching 
HEAD is now at 26e08ba Don't forget Evan
Previous HEAD position was 26e08ba... Don't forget Evan
Switched to branch 'master'
From git://github.com/jruby/jruby
 * branch            master     -> FETCH_HEAD
Already up-to-date.
Copying from repo to src path...
jruby-1.6.7.2 - #ant jar
Error running 'ant jar', please read /usr/local/rvm/log/jruby-1.6.7.2/ant.jar.log
jruby-1.6.7.2 - #ant jar  -Djruby.default.ruby.version=1.9
Error running 'ant jar  -Djruby.default.ruby.version=1.9', please read /usr/local/rvm/log/jruby-1.6.7.2/ant.jar.flags.log
Building Nailgun
jruby-1.6.7.2 - #installing to /usr/local/rvm/rubies/jruby-1.6.7.2
chmod: cannot access `/usr/local/rvm/rubies/jruby-1.6.7.2/bin/jruby': No such file or directory
jruby-1.6.7.2 - #importing default gemsets (/usr/local/rvm/gemsets/)
Copying across included gems
/usr/bin/env: jruby: No such file or directory

ant.jar.log:

[2012-06-28 14:24:57] ant jar
/usr/local/rvm/scripts/functions/utility: line 147: ant: command not found

ant.jar.flags.log

[2012-06-28 14:24:58] ant jar  -Djruby.default.ruby.version=1.9
/usr/local/rvm/scripts/functions/utility: line 147: ant: command not found

And I could not see it in rvm list but rvm thinks it's already installed.

Then I've tried some combinations, and I found that once I add --1.9 rvm will checkout from git repository and that error will occur.

If I do not add --1.9:

$ rvm install jruby-1.6.7.2
jruby-1.6.7.2 - #fetching 
jruby-1.6.7.2 - #extracting jruby-bin-1.6.7.2 to /usr/local/rvm/src/jruby-1.6.7.2
jruby-1.6.7.2 - #extracted to /usr/local/rvm/src/jruby-1.6.7.2
Building Nailgun
jruby-1.6.7.2 - #installing to /usr/local/rvm/rubies/jruby-1.6.7.2
jruby-1.6.7.2 - #importing default gemsets (/usr/local/rvm/gemsets/)
Copying across included gems
Fetching: jruby-launcher-1.0.14-java.gem (100%)
Building native extensions.  This could take a while...
Successfully installed jruby-launcher-1.0.14-java
1 gem installed
@mpapis
Member
mpapis commented Jun 28, 2012

that's right for the switch --1.9 rvm will have to run ant tasks which require you to install ant, you could try the jruby-1.7.0.preview1 which will be in 1.9 mode by default and no ant will be needed.

@larryzhao

Thanks a lot @mpapis for all the help. I installed the ant and got everything into working now.

@larryzhao larryzhao closed this Jun 28, 2012
@mpapis
Member
mpapis commented Jun 28, 2012

you could report it to jruby team, I guess this situation could still be affecting jruby 1.7 in the reverse scenario - when using --1.8 flag for gems that are restricted to only ruby 1.8

@larryzhao

Yep, you are right. I will go file a jira.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment