Rails 添加新的运行环境

Rails自带了development、test和production三个environments 我们可以添加Staging

database.yml

staging:  
  adapter: mysql  
  database: store_staging  
  user: root  
  password:   
  host: localhost  

 添加enviromnets/staging.rb

# ...  
config.log_level = :debug  
# ...  

 创建数据库

mysqladmin create store_staging -u root -p  
rake db:migrate RAILS_EVN=staging  

 启动

rails s -e staging  

 

你可能感兴趣的:(Rails)