preloader
軟體工程

Deploy problems when upgrading to rails 5.2.0 from 4.2.5

Capistrano 部署 production 環境 從 Rails 4.2.5.1 升級到 Rails 5.2.0 的環境時遭遇了兩個問題

  1. Cannot find gem bundler >= 0.a

Solution for your production environment:

  • reinstall rvm and bundler gem
rvm implode  
rvm get head rvm reload rvm reset rvm use 2.4.1   
rvm gemset create rails5.2.0  
rvm use [email protected] --default 
gem install bundler 
which bundle

 

  • modify config/deploy.rb content and hidden rvm_type

# set :rvm_type, :user
set :rvm_custom_path, '<PATHWHATYOUWANT>'
set :rvm_ruby_version, '[email protected]'

 

  • cap production bundler:install

 

  1. Cannot find gem rake >= 12.3.1 when
bundle exec passenger-config restart-app <YOURAPP> --ignore-while-not-running

when deploy.rb already have below setting:

set :passenger_restart_with_touch, false
set :passenger_in_gemfile, true

Solution:

=> add config to deploy.rb :

set :passenger_restart_command, '-i passenger-config restart-app'