Home Rails部署时gemfile相关的内容(gemfilesrelatedstuffwhendeployingrailsapptoproduction)
Post
Cancel

Rails部署时gemfile相关的内容(gemfilesrelatedstuffwhendeployingrailsapptoproduction)

1. 最好指定好具体的版本, .e.g:  (give the explicit version ) 

source 'http://ruby.taobao.org'

gem 'rails', '4.0.0'
gem 'uglifier', '2.4.0'
gem 'coffee-rails', '4.0.1'

2. $ bundle package --all

3. 在 config/deploy.rb 中,执行 bundle install --local --without=test , e.g.

  task :db_migrate do
    run "cd #{release_path} && bundle install --local"
    run "cd #{release_path} && bundle exec rake db:migrate RAILS_ENV=production"
  end 

This post is licensed under CC BY 4.0 by the author.