我刚刚收购了Media Temple(dv)4.0服务器来部署我通过git存储库创建的Rails应用程序。我是Rails的新手,但Capistrano的部署看起来非常简单。尽管如此,我整天都在努力完成我的第一个Rails项目的部署。这是我在设置并检查后执行“cap production deploy -v”时遇到的错误:
** [out :: 64.207.184.51] rake aborted!
** [out :: 64.207.184.51] no such file to load -- rubygems
我一直在服务器上安装宝石,所以我不认为没有安装rubygems。这是经过几个小时的调试,为什么它告诉我我的公钥无效。
以下是我的配置文件:
Capfile:
require 'capistrano/ext/multistage'
load 'deploy'
load 'deploy/assets'
load 'config/deploy'
set :application, 'snippet'
set :domain, '[server IP address]'
set :user, 'root'
配置/ deploy.rb
require 'capistrano/ext/multistage'
default_run_options[:pty] = true
set :stages, ["production"]
set :default_stage, "production"
set :application, "[app name]"
set :scm, :git
set :repository, "git@github.com:[github.com repository]"
set :branch, "master"
set :user, "root"
set :use_sudo, false
set :deploy_via, :remote_cache
set :scm_passphrase, "[public ssh key passphrase]"
配置/部署/ production.rb
server "[server IP]", :app, :web, :db, :primary => true
set :deploy_to, "/var/www/vhosts/[domain]/httpdocs"
输出错误:
vespertine:snippet nporteschaikin$ cap production deploy -v
** transaction: start
/Users/nporteschaikin/.rvm/gems/ruby-1.9.2-p320/gems/capistrano-2.13.4/lib/capistrano/recipes/deploy.rb:107: warning: Insecure world writable dir /Users/nporteschaikin/.rvm/gems/ruby-1.9.2-p320/bin in PATH, mode 040777
Password:
** [IP-ADDRESS :: out] Enter passphrase for key '/root/.ssh/id_rsa':
** [IP-ADDRESS :: out]
** [IP-ADDRESS :: out] Enter passphrase for key '/root/.ssh/id_rsa':
** [IP-ADDRESS :: out]
** [out :: IP-ADDRESS] (in /var/www/vhosts/[domain.com]/httpdocs/releases/20121021210706)
** [out :: IP-ADDRESS] rake aborted!
** [out :: IP-ADDRESS] no such file to load -- rubygems
** [out :: IP-ADDRESS] /var/www/vhosts/[domain.com]/httpdocs/releases/20121021210706/Rakefile:5:in `require'
** [out :: IP-ADDRESS] (See full trace by running task with --trace)
*** [deploy:update_code] rolling back
failed: "sh -c 'cd /var/www/vhosts/[domain.com]/httpdocs/releases/20121021210706 && rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile'" on IP-ADDRESS
请帮忙!我在服务器上安装了RVM,Ruby,Passenger和Rails。