3

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

Could not find i18n-0.6.4 in any of the sources

现在,我看到了其他类似的帖子,但它们都指向乘客问题,而在我的情况下,我在服务器上安装了 nginx(Ubuntu Server 12.04)。

我对 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
4

1 回答 1

3

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

谢谢你们,在使用cap shellcap invoke COMMAND=进行了一些测试后,我最终清理了 capistrano 配方,在服务器端修复了一些符号链接,我让它工作了。谢谢大家!

~ 每个加斯顿康西里奥的回答

于 2013-10-08T05:20:23.090 回答