【问题标题】:ror deployment with capistrano -> cap:deploy使用 capistrano 进行 ror 部署 -> cap:deploy
【发布时间】:2012-07-13 05:44:11
【问题描述】:

我的部署有问题。 我有一个 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?

【问题讨论】:

    标签: ruby-on-rails deployment path capistrano rvm-capistrano


    【解决方案1】:

    我正在使用带有 RVM 的 capistrano,没有任何问题,遵循 https://rvm.io//integration/capistrano/ 处的“通过 rvm-capistrano gem 集成”部分说明。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-08
      • 2016-03-29
      • 2012-10-03
      • 1970-01-01
      • 2018-09-27
      相关资源
      最近更新 更多