質問

I am getting the error Bundler::GemNotFound: Could not find minitest-4.7.5.gem for installation when I am running cap deploy. Longer trace: http://pastie.org/9151939

I have manually installed minitest (the required version) and I do not have local copies of gems, i.e. the directory vendor/cache does not exist. Moreover, I have nowhere not mentioned the minitest gem in my Gemfile. I don't know which gem requires the minitest gem.

I updated my gemfile.lock (by running bundle update, and pushing my changes) but still I get the same error. I even deleted the application directory from my server and also the .rvm directory suspecting something went wrong with that.

Any help, even on what's causing this error or on how to proceed, would be greatly appreciated.

Additional Information:

Everything was fine until I made the following changes:

To config/environments/production.rb, I added config.assets.precompile = ['*.js', '*.css', '*.css.erb'] since apparently all the assets were not being loaded.

Also, I recently changed my 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
役に立ちましたか?

解決

Login to the server by ubuntu user and run gem update bundler and after cap deploy from local machine.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top