Rails 3 — Bundler/Capistrano Errors

前端 未结 8 1582
攒了一身酷
攒了一身酷 2020-12-07 13:39

I have a basic Rails 3 app working locally on my development box, but want to test out deploying early on to make sure everything works. I\'m using Capistrano to deploy.

8条回答
  •  时光说笑
    2020-12-07 13:43

    UPDATE:

    For RVM >= 1.11.3, you should now just use the rvm-capistrano gem. For older RVM >= 1.0.1, the answer below still applies.


    ORIGINAL ANSWER:

    Okay, though I still haven't gotten a full cap deploy to work, I did fix this problem. The problem was Capistrano trying to use a different path for Bundler (and other gems) than the RVM paths.

    Check your Capistrano path by doing cap shell, then echo $PATH. You'll probably see your standard /usr/local/bin and /usr/bin, but that's not where RVM has Bundler, et al., stored.

    Edit your Capistrano config/deploy.rb file, and add the following lines, per these instructions:

    # Add RVM's lib directory to the load path.
    $:.unshift(File.expand_path('./lib', ENV['rvm_path']))
    
    # Load RVM's capistrano plugin.    
    require "rvm/capistrano"
    
    set :rvm_ruby_string, '1.9.2'
    set :rvm_type, :user  # Don't use system-wide RVM
    

    That finally got Capistrano to see Bundler and start loading gems appropriately.

提交回复
热议问题