ruby-on-rails - cap 部署错误 - 无法在任何来源中找到 i18n-0.6.4

标签 ruby-on-rails capistrano bundler

我正在尝试部署我的应用程序 (cap deploy:cold),一切顺利,直到:

Could not find i18n-0.6.4 in any of the sources

现在,我看到了其他类似的帖子,但它们都指向一个 Passenger 问题,在我的例子中,我在服务器 (Ubuntu Server 12.04) 上安装了 nginx。

我对 Rails 比较陌生,所以我可能会在这里遗漏一些基本的东西,但我知道 i18n 是本地安装的 (OS X Mountain Lion),'bundle show i18n' 给我:

/Users/myhomedirectory/.rvm/gems/ruby-1.9.3-head/gems/i18n-0.6.4

问题出在我的服务器上吗?我该如何处理?

预先感谢您的帮助!

Capistrano 配方下方

require "rvm/capistrano"

server 'myserverip', :web, :app, :db, primary: true

set :application, "siac"
set :user, "deployer"
set :deploy_to, "/home/#{user}/apps/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false

set :rvm_type, :system

set :scm, :git
set :repository,  "mygitdir"
set :branch, "master"

default_run_options[:pty] = true
ssh_options[:forward_agent] = true

namespace :deploy do
  %w[start stop restart].each do |command|
    desc "#{command} unicorn server"
    task command, roles: :app, except: {no_release: true} do
      run "/etc/init.d/unicorn_#{application} #{command}"
    end
  end

  task :setup_config, roles: :app do
    sudo "ln -nfs #{current_path}/config/nginx.conf /etc/nginx/sites-enabled/#{application}"
    sudo "ln -nfs #{current_path}/config/unicorn_init.sh /etc/init.d/unicorn_#{application}"
    run "mkdir -p #{shared_path}/config"
    put File.read("config/database.yml.tpl"), "#{shared_path}/config/database.yml"
    puts "Now edit the config files in #{shared_path}."
  end
  after "deploy:setup", "deploy:setup_config"

  task :symlink_config, roles: :app do
    run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
  end
  after "deploy:finalize_update", "deploy:symlink_config"

  desc "Make sure local git is in sync with remote."
  task :check_revision, roles: :web do
    unless `git rev-parse HEAD` == `git rev-parse origin/master`
      puts "WARNING: HEAD is not the same as origin/master"
      puts "Run `git push` to sync changes."
      exit
    end
  end
  before "deploy", "deploy:check_revision"
end

和堆栈跟踪:

  * executing "cd -- /home/deployer/apps/siac/releases/20130319035235 && rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile && cp -- /home/deployer/apps/siac/shared/assets/manifest.yml /home/deployer/apps/siac/releases/20130319035235/assets_manifest.yml"
    servers: ["myserverip"]
    [myserverip] executing command
 ** [out :: myserverip] Could not find i18n-0.6.4 in any of the sources
 ** [out :: myserverip] Run `bundle install` to install missing gems.
    command finished in 905ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /home/deployer/apps/siac/releases/20130319035235; true"
    servers: ["myserverip"]
    [myserverip] executing command
    command finished in 627ms
failed: "rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell 'default' -c 'cd -- /home/deployer/apps/siac/releases/20130319035235 && rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile && cp -- /home/deployer/apps/siac/shared/assets/manifest.yml /home/deployer/apps/siac/releases/20130319035235/assets_manifest.yml'" on myserverip

最佳答案

从评论中复制答案以便从“未回答”过滤器中删除此问题:

Thank you guys, after doing some tests with cap shell and cap invoke COMMAND=, I ended up cleaning up the capistrano recipe, fixing some sym links on the server side and I got it to work. Thanks to all!

~ 根据 Gaston Concilio 回答

关于ruby-on-rails - cap 部署错误 - 无法在任何来源中找到 i18n-0.6.4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15491080/

相关文章:

ruby - 如何 bundle html 管道安装后消息中提到的 Filter gem 依赖项?

ruby-on-rails-3 - 安装pg(0.12.2)时出错,Bundler无法继续

php - 将 MySQL 数据从旧 PHP 应用程序迁移到 Rails 应用程序

ruby-on-rails - Ruby on Rails 和领域驱动开发

ruby-on-rails - Capistrano 版本冲突

mysql - Rails4 部署 ActiveRecord::AdapterNotSpecified

使用 Action-Cable 的 Ruby-on-Rails 应用程序在开发中运行,但在生产模式中失败

ruby-on-rails - 如何在Jekyll中处理模板(布局)继承?

capistrano - 有没有办法可以看到 capistrano 任务依赖项

ruby - 在没有 bundler 的新机器上从 bundler 包中安装 gem