使用RAILS时几个需要环境参数的命令, 使用的方法都不一样, 有点不可思议.每次使用脑子都要多转一下,到底该用哪种方式.
script/server: 是跟在-e后面
script/server -e production
而script/console不需要. 这两个命令都不一致,实在不好理解
script/console production
rake则是环境变量的用法
rake db:migrate RAILS_ENV=production
本文探讨了使用Rails框架时不同环境配置命令的使用方法及其差异性。包括script/server、script/console及rake命令的不同调用方式,对于初学者来说具有一定指导意义。
使用RAILS时几个需要环境参数的命令, 使用的方法都不一样, 有点不可思议.每次使用脑子都要多转一下,到底该用哪种方式.
script/server: 是跟在-e后面
script/server -e production
而script/console不需要. 这两个命令都不一致,实在不好理解
script/console production
rake则是环境变量的用法
rake db:migrate RAILS_ENV=production

被折叠的 条评论
为什么被折叠?