1

我刚刚获得了一个 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

我整天都在服务器上安装 gems,所以我认为没有安装 ruby​​gems。这是经过数小时的调试,为什么它告诉我我的公钥无效。

这是我的配置文件:

帽文件:

require 'capistrano/ext/multistage'

load 'deploy'
load 'deploy/assets'
load 'config/deploy'
set :application, 'snippet'
set :domain, '[server IP address]'
set :user, 'root'

配置/部署.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。

4

0 回答 0