0

我的部署有问题。我有一个 ubuntu 11.10 服务器,我已经安装了带有 RVM 的 ruby​​ 1.9.2 和 rails 3.2.6。我还没有拉出我的 git,它位于 /home/ ** /idepro.git 我运行了“capify”。命令,我修改了 deploy.rb 文件。当我运行命令“cap deploy:setup”和“cap deploy:check”时我没有任何问题,但是当我运行“cap deploy”时,我遇到了环境路径问题。错误是:

** [out :: 176.58.****] /usr/bin/env: ruby
** [out :: 176.58.****] : No such file or directory

这些是 ror 的路径:

******@******:~$ which ruby
/home/******/.rvm/rubies/ruby-1.9.2-p320/bin/ruby

这是 $PATH 的值:

******@******:~$ echo $PATH
/home/******/.rvm/gems/ruby-1.9.2-p320/bin:/home/******/.rvm/gems/ruby-1.9.2-p320@global/bin:/home/******/.rvm/rubies/ruby-1.9.2-p320/bin:/home/******/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/******/.rvm/gems/ruby-1.9.2-p320/bin

这是我的 deploy.rb 文件:

# RVM bootstrap
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
#require 'rvm/capistrano'
set :rvm_ruby_string, 'ruby1.9.2-p290'

# bundler bootstrap
require 'bundler/capistrano'

# main details
set :application, "176.58.******"
role :web, "176.58.******"
role :app, "176.58.******"
role :db,  "176.58.******", :primary => true

ssh_options[:port] = ******
set :user, "******"
set :password, "******"

# server details
default_run_options[:pty] = true
ssh_options[:forward_agent] = true
set :deploy_to, "/var/www/idealarm2"
set :deploy_via, :remote_cache
set :user, "passenger"
set :use_sudo, false

# repo details
set :scm, :git
set :scm_username, "passenger"
set :repository, "/home/******/idepro.git"
set :branch, "master"
set :git_enable_submodules, 1

# tasks
namespace :deploy do
    task :start, :roles => :app do
         run "touch #{current_path}/tmp/restart.txt"
    end

    task :stop, :roles => :app do
         # Do nothing.
    end

    desc "Restart Application"
    task :restart, :roles => :app do
         run "touch #{current_path}/tmp/restart.txt"
    end
end

#default_environment['PATH']='/home/******/.rvm/gems/ruby-1.9.2-p320/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin/:/usr/bin:/bin'
#default_environment['GEM_PATH']='/home/******/.rvm/gems/ruby-1.9.2-p320:/home/******/.rvm/gems/ruby-1.9.2-p320@global:/usr/lib/ruby/gems/1.$

任何人都可以帮助我进行 PATH 配置吗?

4

1 回答 1

2

我将 capistrano 与 RVM 一起使用,没有任何问题,遵循https://rvm.io//integration/capistrano/上的“通过 rvm-capistrano gem 集成”部分说明。

于 2012-07-13T11:25:49.483 回答