Reputation: 1819
I'm new to Rails
and am confused about running my RoR code on server (from linode.com). I have been developing my RoR application locally and I start my server using the rails server
command. However, when I ported the same code to my server (git clone
) and ran the command its asking me to create a new app. How can I make rails run my app? Also, what config changes are required to run the app on production environment.
I saw this, but am very confused about starting the server.
Upvotes: 1
Views: 713
Reputation: 211710
It's highly unusual to see rails server
used in production. Performance will be absolutely abysmal since it's constrained to a single process.
Most Rails projects employ a deployment tool like Capistrano to help automate the process of shipping code, building assets, and other steps required to make the application ready to power up.
It's also necessary to use a Rails hosting helper like Passenger to manage the Rails processes. There are others like Unicorn or Puma you might want to try, but the principles are similar.
Normally you'll need to prepare a different set of configuration files for your production
environment. I strongly recommend keeping database passwords, API keys, and other sensitive information on the server itself, not checked into your repository. Most deployment tools make it easy to copy or link these into the appropriate place each time you deploy.
Upvotes: 4
Reputation: 11876
rails server -e production
It will run the server in production environment.
Upvotes: -2