アセットプリコンパイルステップで、Capistranoのデプロイ中に次のエラーが発生しています。私は、以下のコマンドを実行なぜcapistranoアセットはci/reporter/rake/rspecエラーを投げてプリコンパイルされますか?
rake aborted!
LoadError: cannot load such file -- ci/reporter/rake/rspec
/home/ubuntu/github/my_app/releases/20160806071639/Rakefile:4:in `require'
/home/ubuntu/github/my_app/releases/20160806071639/Rakefile:4:in `<top (required)>'
/home/ubuntu/github/my_app/shared/bundle/ruby/2.0.0/gems/rake-11.2.2/exe/rake:27:in `<top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.12.5/lib/bundler/cli/exec.rb:63:in `load'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.12.5/lib/bundler/cli/exec.rb:63:in `kernel_load'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.12.5/lib/bundler/cli/exec.rb:24:in `run'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.12.5/lib/bundler/cli.rb:304:in `exec'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.12.5/lib/bundler/cli.rb:11:in `start'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.12.5/exe/bundle:27:in `block in <top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.12.5/lib/bundler/friendly_errors.rb:98:in `with_friendly_errors'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.12.5/exe/bundle:19:in `<top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p481/bin/bundle:23:in `load'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p481/bin/bundle:23:in `<main>'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p481/bin/ruby_executable_hooks:15:in `eval'
/home/ubuntu/.rvm/gems/ruby-2.0.0-p481/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)
、
キャップステージングだから
を展開、私は私の配布ファイルで何かを見逃しているかどうかを確認するために、リリースフォルダ内の~/.rvm/bin/rvm default do bundle exec rake assets:precompile
を実行してみました。しかし、そこにも失敗しました。
私のデプロイメントディレクトリ(cap deploy
コマンドを実行している場所)から同じコマンド、~/.rvm/bin/rvm default do bundle exec rake assets:precompile
を実行すると、正常に実行されます。続き
は
Ruby version = 2.0.0
Rails version = 3.2.21
Capistrano version = 3.4.0
マイdeploy.rb
ファイル(私はgithubのURLを変更した)、
# config valid only for current version of Capistrano
lock '3.4.0'
set :application, 'my_app'
set :repo_url, '[email protected]:xyz/my_app.git'
set :branch, ENV["REVISION"] || ENV["BRANCH_NAME"] || "master"
set :deploy_root, "/home/ubuntu/github/"
set :deploy_to, "#{fetch(:deploy_root)}my_app"
set :bundle_flags, "--local --no-cache"
set :scm_passphrase, ""
set :use_sudo, false
set :ssh_options, {:forward_agent => true}
set :copy_exclude, [ '.git' ]
set :rails_env, "staging"
set :keep_releases, 1
set :run_bundle_install, true
set :run_precompile, true
set :run_db_migrate, false
set :run_rspec, false
set :stage, :production
server "127.0.0.1", user: "ubuntu", roles: %w{web app}
set :linked_files, %w{config/database.yml config/database.yml}
# Default branch is :master
# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
# Default deploy_to directory is /var/www/my_app_name
# set :deploy_to, '/var/www/my_app_name'
# Default value for :scm is :git
# set :scm, :git
# Default value for :format is :pretty
# set :format, :pretty
# Default value for :log_level is :debug
# set :log_level, :debug
# Default value for :pty is false
set :pty, true
# Default value for :linked_files is []
# set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')
# Default value for linked_dirs is []
# set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system')
# Default value for default_env is {}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
# Default value for keep_releases is 5
# set :keep_releases, 5
namespace :deploy do
desc "Restart sidekiq"
task :restart_sidekiq do
run <<-CMD
cd fetch(current_path) && script/sidekiq restart -e #{rails_env}
CMD
end
desc "Restart application"
task :restart do
on roles(:app), in: :sequence, wait: 5 do
execute :touch, release_path.join("tmp/restart.txt")
end
end
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
# Here we can do anything such as:
# within release_path do
# execute :rake, 'cache:clear'
# end
end
end
#after :finishing, "deploy:restart"
after :finishing, "deploy:restart_sidekiq"
after :finishing, "deploy:cleanup"
end
マイCapfile、
# Load DSL and set up stages
require 'capistrano/setup'
# Include default deployment tasks
require 'capistrano/deploy'
# Include tasks from other gems included in your Gemfile
#
# For documentation on these, see for example:
#
# https://github.com/capistrano/rvm
# https://github.com/capistrano/rbenv
# https://github.com/capistrano/chruby
# https://github.com/capistrano/bundler
# https://github.com/capistrano/rails
# https://github.com/capistrano/passenger
#
require 'capistrano/rvm'
# require 'capistrano/rbenv'
# require 'capistrano/chruby'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
# require 'capistrano/passenger'
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
Gemfileのスナップショット、
、環境設定されていますgem 'capistrano', '3.4.0'
gem 'sshkit', '1.11.2'
gem 'net-scp', '1.2.1'
gem 'capistrano-rails', '1.1.7'
gem 'capistrano-bundler', '1.1.4'
gem 'capistrano-rvm', '0.1.2'
詳細情報が必要な場合はお知らせください。