Search code examples
ruby-on-railsdevelopment-environmentproduction-environment

Single App or Separate Apps for Development/Production in Rails


I'm using Bluehost and I'm relatively new to Rails (and Ruby). Here's my current setup:

  • One app on my local HD
  • Two apps on cPanel

    /rails_apps/myAppDev on "dev.myApp.com"
    /rails_apps/myAppPro on "myApp.com"

Do I really have to keep ftping the same local file(s) to both the dev and production apps or is there something about rails environments that I'm not understanding?


Solution

  • If you use Passenger, you can have one application available in two different environments (here is a discussion you might find useful). I am not claiming this is the only way to do it - but it is the only one I am aware of.

    Other than that, check the configuration file (config/environment.rb, if I am not mistaken) (see this question) - although I am afraid this will require you to restart your app server every time you make a change and make your app available in only one environment at a time.

    Aside from that, I think it is a good idea to test your app in the development mode before switching to production.

    I have no idea about Bluehost (I am self-hosting), but I think this should help you a little before someone who knows their service helps you better :)