这三者是不一样的,而且极其容易混淆
在console中指定测试模式:
rails c test
在服务器启动时指定环境:
$ rails server --environment production
上述命令又必须需要存在相应的数据库
因此在迁移命中制定环境如下:
$ bundle exec rake db:migrate RAILS_ENV=production
这三者是不一样的,而且极其容易混淆
在console中指定测试模式:
rails c test
在服务器启动时指定环境:
$ rails server --environment production
上述命令又必须需要存在相应的数据库
因此在迁移命中制定环境如下:
$ bundle exec rake db:migrate RAILS_ENV=production