0

I have a project which

  1. uses rvm ruby 1.9.2 (set in .rvmrc in project dir).
  2. deploying with capistrano.
  3. has a rake task I want to run remotely from my local machine by capistrano.

I've created a .sh file to run my task:

cd /var/www/pluslook/current
/home/kirill/.rvm/scripts/rvm use 1.9.2@pluslook
/home/kirill/.rvm/gems/ruby-1.9.2-p180@pluslook/bin/rake parse:feed RAILS_ENV="production" --trace

But when I'm trying to run this task i have an error:

Using /home/kirill/.rvm/gems/ruby-1.9.2-p180 with gemset pluslook
Could not find linecache19-0.5.12 in any of the sources
Run `bundle install` to install missing gems.

I've installed all my gems in project's current directory so it looks like rake task is running from another directory. When I'm trying to run task from capistrano, It shows me the same error.

Thank you and sorry for my English:)

Kirill
  • 91
  • 6

1 Answers1

1
  1. do you have 'require "bundler/capistrano"' in config/deploy.rb
  2. did you run "bundle install" before commit latest code changes?
Anatoly
  • 15,298
  • 5
  • 53
  • 77
  • Sure. When run a "bundle install" from my "current" directory its ok: _Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed._ – Kirill Jul 16 '11 at 18:15
  • do you have latest Gemfile.lock in the repo? what's version Bundler do you use? – Anatoly Jul 16 '11 at 18:16
  • Yes I have Gemfile.lock and bundler version is 1.0.15. The thing that it works if I'am in /current directory but when I trying to run rake from remote machine I have an error. – Kirill Jul 17 '11 at 07:13
  • it's the rubygems specific version bug. what's the rubygems version do you have? many of us have some kind of problems and rubygems downgrade solved them. can you try to [this](http://groups.google.com/group/rails-oceania/browse_thread/thread/4c673ccd0f659875) out please? – Anatoly Jul 17 '11 at 12:28
  • do you use RVM on server? if so, please check your config with according to [documentation](http://beginrescueend.com/integration/capistrano/). require "rvm/capistrano", set :rvm_ruby_string, 'ruby-1.9.2-p180@pluslook' – Anatoly Jul 17 '11 at 14:01
  • Thanks I think that problem is solved. To deploy.rb I've add "set :rvm_ruby_string, '1.9.2@pluslook'", "set :rvm_type, :user" for .sh "source /home/kirill/.rvmrc" – Kirill Jul 17 '11 at 15:05
  • actually, I never use RVM on production, just only one ruby version at the one time. RVM is primarely is for developer usage IMHO – Anatoly Jul 17 '11 at 15:07
  • May be.. But I have a couple of small projects on one server with different ruby versions.. – Kirill Jul 17 '11 at 15:23