Ruby on Rails

$ rails console --sandbox Loading development environment in sandbox Any modifications you make will be rolled back on exit >>

Rails Environment

三種環境:test, development, production

$ rails console # 預設環境: development

# 在 test 環境執行 console

$ rails console test

# 指定 local Rails server 的環境

$ rails server --environment production

# 產生 production 環境的資料庫

$ bundle exec rake db:migrate RAILS_ENV=production

References