I just learned Ruby/RoR but I don’t know how to deploy RoR apps in production environment. What server should I to use, Apache, NGINX?
I’ve worked with PHP before and I used Apache on a vserver with Arch Linux. But now I want to set up a new vserver for RoR Projects.
Can someone give me a few tips because I have a few starting difficulties.
Not easy, if you have money to spare I would recommend Heroku.
Otherwise it’s a lot more complicated, I personally use capistrano on an AWS EC2 instance.
Hi Dorian, thank you for your help.
I finished my setup with a vServer
2 GB RAM
40 GB SSD (RAID10)
and it works. But what I don’t understand, this
rails server -e production
is doesn’t work, but
rails server -b 0.0.0.0
Know somebody why?
Do I need for the production a production server?
you would need to do
rails server -e production -b 0.0.0.0
Here is a good article for setting up a reasonable production environment on a cloud linux virtual server. I use something similar, except my deployment is via git.
PLEASE DON’T RUN
rails server ... outside your local development environment
After using for several years this same stack on Ubuntu, our AWS Expert recommended us to move to Amazon Linux 2 in order to take advantage…
Reading time: 11 min read
I had already tried that. But Rails threw errors.
Hallo Vlad, thank you for your help.
I skimmed the article and it looks promising.
What do you mean by that and why?
Rails is a single-threaded platform, so you need to run multiple processes for performance.
You need some kind of process manager to start/restart the services if they die due to OS issues.
Research the topic on Google.
Hi Vlad, thank you for your post.
I currently have 3 Rails projects running on my vServer. The solution may not be the best, but it works for now with
domain.tld:3001 until domain.tld:3003
I’m now putting my focus more on a Rails project.
Thanks to all
A easier solution to deploy multiple rails app on the same virtual server is to use
Dokku, The installation for Dokku is straight forward and it allows you to have your own person heroku like paas. I’ve been using it for RubyOnRemote on a $6 Vultr VM without any issues. You can also leverage BuildPacks from Heroku if you need to customize your setup.
Using Dokku removes a lot of work for infra management and lets you focus on writing your apps instead of figuring out how to run them.
Do give it a try, all the best!
EKrubyguy. That sounds good.
Many Thanks. I’ll try it when I get a chance.
Thank you for your help
EKrubygu y. That worked for me!