![]() |
| Development --> Production. How? |
|
sonoflight
|
Hello, I curious how to go from the development setting to production setting on a Rails application hosted with HMS. I have been doing most of the generators on the server, downloading the app structure, modifying the files, and then re-uploading. I understand this is not the cleanest development cycle, however I am just curious if the app on the server is running in Production or Development mode, and if it is in development - how to get it kicked into production mode.
Thanks in advance. |
||||||||||||
|
|
|||||||||||||
|
pmeserve
HostMySite Tech
|
By default your app will be running in development mode. To switch it(which will speed up the app), just edit the file "config/environment.rb" - around the 5th line you'll see:
just uncomment the line, so it reads:
|
||||||||||||||||
|
|
|||||||||||||||||
|
sonoflight
|
Yes, PME that is correct - however if you notice at the top of the environment.rb file it says anytime you make a change to this file that you need to restart your app server . . .
So its not as simple as a change with that line of code. Can you give suggestions regarding how to truly kick over a rails app into production mode once we have modified that line of code? Gracias |
||||||||||||
|
|
|||||||||||||
|
pmeserve
HostMySite Tech
|
Well the mod_fastcgi servers should restart themselves automatically from time to time. If you want to give your server a kick, try the following at the command line:
You can also just let HMS support know, we can do this as well |
||||||||||||||
|
|
|||||||||||||||
|
edgerunner
|
If you're using git or another versioning system, forcing rails into production from environment.rb gets annoying quickly, as you either have to keep being forced into production on your local machine, or remotely uncomment the line in environment.rb every time you push to the server.
The solution I found was changing the said line to:
then rails forces itself into production mode only if there is a config/production.force file. |
||||||||||||||
|
|
|||||||||||||||
|
AdminMyServer
|
edgerunner - That's a good trick. You could also modify the environment.rb file or use a separate config file(either .rb or .yml) that you push to the server using capistrano. Using capistrano or a similar deployment tool is really a must for everyone with a website, whether it's using Rails or not
|
||||||||||||
|
|
|||||||||||||
| Development --> Production. How? |
|
||
|


