1

This problem is plaguing me for hours now.

I have installed RVM to system directory and if I were to comment out in the Capfile:

load 'deploy/assets'

This runs fine and my app is deployed.

However, once I uncomment that line, capistrano will do an asset:precompile, which I need. This throws me the following error:

Could not find multi_json-1.0.4 in any of the sources

The issue appears to be bundler installing gems into a different directory under rvm while going through capistrano. Where it should install to rvm_path/gems/gemset_path/, it installs it to rvm_path/gems/gemset_path/ruby/1.9.1/, as documented here in this post: RVM, Capistrano and bundler path issues.

Has anyone else ran into this issue, and figured out a way to resolve this?

Thanks!

EDIT:

Finally found the solution to this. This link explains it: https://github.com/capistrano/capistrano/issues/81.

Basically all that needed to be done was to do a bundle install before doing asset:precompile, and it was irrelevant from the issue I raised in my question.

Just adding this in the deploy.rb helped:

before "deploy:assets:precompile", "bundle:install"
Community
  • 1
  • 1
gtr32x
  • 2,033
  • 4
  • 20
  • 32

1 Answers1

2

Actually, the simplest way to do this is just to upgrade to Bundler 1.0.8. That solves the issue of not running bundle install before asset compilation.

gtr32x
  • 2,033
  • 4
  • 20
  • 32
  • Bundler 1.8 ?! Bundler is in 1.1 rc now. – Vijay Dev Feb 25 '12 at 17:07
  • My bad, thanks for the correction Vijay, I meant Bundler 1.0.8 haha. Post is corrected. – gtr32x Feb 25 '12 at 17:09
  • 1
    I'm having same problem. Bundler is at v1.0.21 on client and server. And `bundle:install` is not done automatically?!? Must we still add `before "deploy:assets:precompile", "bundle:install"`? – Meltemi Feb 26 '12 at 02:04
  • Hey Meltemi, nah you don't have to add it. If you just upgrade your bundler to at least 1.0.8 on the local machine that's doing the deployment. If it is below 1.0.8, then you have to add that line. – gtr32x Feb 26 '12 at 08:10