' MINITEST'生产捆绑安装期间未找到gem

时间:2014-05-08 07:02:10

标签: ruby-on-rails capistrano

我在运行Bundler::GemNotFound: Could not find minitest-4.7.5.gem for installation时收到错误cap deploy。更长的追踪:http://pastie.org/9151939

我手动安装了minitest(所需版本),我没有gems的本地副本,即目录vendor/cache不存在。而且,我在minitest中没有提到Gemfile宝石。我不知道哪个宝石需要minitest宝石。

我更新了我的gemfile.lock(通过运行bundle update并推送我的更改)但仍然得到相同的错误。我甚至从我的服务器和.rvm目录中删除了应用程序目录,怀疑它出了什么问题。

任何帮助,即使是导致此错误的原因或如何继续,都将不胜感激。

其他信息:

在我做出以下更改之前,一切都很好:

config/environments/production.rb,我添加了config.assets.precompile = ['*.js', '*.css', '*.css.erb'],因为显然所有资产都没有加载。

另外,我最近更改了deploy.rb

require "bundler/capistrano"
require "rvm/capistrano"

server "54.255.153.68", :app, :web, :db, :primary => true #ip of the server
# set :stages, %w{testing production}
# set :default_stage, "production"
set :application, "manndi"

set :repository,  "git@bitbucket.org:vedanta/manndi.git"
set :branch, "master"
set :scm, :git # You can set :scm explicitly or Capistrano will make an intelligent guess based on known version control directory names
# set :migrate_target,  :current
# set :ssh_options,     { :forward_agent => true }
# set :normalize_asset_timestamps, false
set :rails_env, "production"

# set :rvm_ruby_string, '2.1.0'             # ruby version you are using...

set :user, "ubuntu"

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

default_run_options[:pty] = true
ssh_options[:forward_agent] = true
ssh_options[:keys] = ["/home/vedant/.ssh/vedanta-key-pair-singapore.pem"]

set :rvm_ruby_string, :local        # use the same ruby as used locally for deployment

before 'deploy', 'rvm:install_rvm'  # install/update RVM
before 'deploy', 'rvm:install_ruby' # install Ruby and create gemset (both if missing)

# Disabling bundle --deployment when using gemsets
set :bundle_dir, ''
set :bundle_flags, '--system --quiet'

after "deploy", "deploy:cleanup" # keep only the last 5 releases

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"), "#{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 # TODO make this a check to exit rather than exit
    end
  end
  before "deploy", "deploy:check_revision"
  before "deploy:setup", "deploy:check_revision"
  before "deploy:cold", "deploy:check_revision"
  # TODO combine above 3 lines
end

1 个答案:

答案 0 :(得分:0)

ubuntu用户登录服务器并在本地计算机上gem update bundler之后运行cap deploy