I currently have a RoR application set up in a (semi-)production environment on a remote server (Debian).
My stack is:
- ruby 1.9.2p136
- Rails 3.0.3
- lighttpd 1.4.26
- thin 1.2.7
- mongoDB 1.6.5
- Bundler and numerous gems
It’s working OK right now, but setting it up was a real nuisance (conflicts and old Debian packages). Because of that, once it worked, I was doing all the customizations in the application code remotely. It was acceptable as a temporary solution (for small fixes), but now I have to dig deeper, thus my need for a full local development environment (with proper debugging).
What would be the best approach to replicate my production setup locally (Ubuntu) as faithfully as possible? I’m a bit perplexed by the multitude of gems installed (as I get the feeling it’s all in a “just don’t touch as long as it’s working” state).
Is switching at this moment to RVM on the remote server worth the trouble? And in general, how do you otherwise cope with multiple RoR projects with separate dependencies when developing locally?
Lastly, after I replicate the stack, what to do with the (sub)domains? From this question I suppose modifying /etc/hosts should suffice, but is there some better way so that the actual production site remains accessible?
I have a similar setup with Ubuntu as my local host and Centos as my remote host. I had setup my remote (production) server first and then, wanted to replicate it on my local (development) server.
However, I did want to develop on different Ruby environments depending upon the requirements of the project.
So, I setup RVM on my local server, with one of the RVM Ruby@Gemset configuraton resembling exactly what I had on my production server.
Depending upon the applications you use, and their ruby version requirements, you can switch to RVM on your production server.
Just remember to make good use of RVM’s
.rvmrcProject files,defaultandsystemtags.