2017-12-08 16 views
0

capistranoを使って自分のレールアプリケーションをデプロイしようとしていますが、バンドルstdout:/home/deploy/.rvm/scripts/set:line 19:exec:バンドル:見つかりません "エラー。私はバンドルを見つけることができないcapistranoまだサーバー上のバンドラーの宝石をインストールしました。capistranoを使ってrailsアプリケーションをデプロイできませんでした。バンドルが見つかりませんでした。

Capfile内容:

require 'capistrano/setup' 
require 'capistrano/deploy' 
require 'capistrano/bundler' 
require 'capistrano/rvm' 
require 'capistrano/rails/assets' # for asset handling add 
require 'capistrano/rails/migrations' # for running migrations 
require 'capistrano/puma' 
require 'capistrano/rake' 

install_plugin Capistrano::Puma 
# Load custom tasks from `lib/capistrano/tasks` if you have any defined 
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r } 

Deploy.rb内容:

lock '3.10.0' 

set :application, 'app_name' 
set :repo_url, 'my-repo-url' # Edit this to match your repository 
set :branch, :branch_name 
set :deploy_to, '/home/deploy/app_name' 
set :pty, true 
set :linked_files, %w{config/database.yml config/application.yml} 
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system public/uploads} 
set :keep_releases, 3 
set :rvm_type, :user 
set :rvm_ruby_version, 'ruby-2.3.1' # Edit this if you are using MRI Ruby 

set :puma_rackup, -> { File.join(current_path, 'config.ru') } 
set :puma_state, "#{shared_path}/tmp/pids/puma.state" 
set :puma_pid, "#{shared_path}/tmp/pids/puma.pid" 
set :puma_bind, "unix://#{shared_path}/tmp/sockets/puma.sock" #accept array for multi-bind 
set :puma_conf, "#{shared_path}/puma.rb" 
set :puma_access_log, "#{shared_path}/log/puma_error.log" 
set :puma_error_log, "#{shared_path}/log/puma_access.log" 
set :puma_role, :app 
set :puma_threads, [0, 16] 
set :puma_workers, 0 
set :puma_worker_timeout, nil 
set :puma_init_active_record, true 
set :puma_preload_app, false 
set :puma_prune_bundler, true 

namespace :deploy do 
    desc 'Restart application' 
    task :restart do 
    on roles(:app), in: :sequence, wait: 5 do 
     invoke 'puma:restart' 
    end 
    end 

    after :finishing, :compile_assets 
    after :finishing, :cleanup 
    after :finishing, :restart 
end 

Production.rb内容:

server 'My-IP', user: 'deploy', roles: %w{web app db} 
set :puma_env, fetch(:rack_env, fetch(:rails_env, 'production')) 

答えて

1

rvmcapistranoを使用してRailsのアプリケーションを展開する場合、あなたが持っています慎重にカピストラーノがRubyのバージョンであり、あなたが見るのと同じルビーバージョンではないかもしれません。

あなたは、リモートサーバーへのSSH、あなたがruby-2.3.1内に設置されたバンドルを表示できない場合は自分で

ssh [email protected] 
ruby -v  # It's probably not 2.3.1 
which bundle 
rvm use 2.3.1 # This is the actual version will be used by capistrano 
which bundle 

を確認することができ、手動でその後

rvm use 2.3.1 
gem install bundler 

capistrano展開してインストールすることができます期待どおりに動作するはずです。

+0

ありがとう、私の問題を解決しました。 – user3542450

関連する問題