Capistrano + RVM + Rake task

南楼画角 提交于 2020-01-25 08:29:11

问题


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


回答1:


  1. do you have 'require "bundler/capistrano"' in config/deploy.rb
  2. did you run "bundle install" before commit latest code changes?


来源:https://stackoverflow.com/questions/6717089/capistrano-rvm-rake-task

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