How to configure Ruby on Rails app going from port 3000 to deployment?

Posted January 23, 2015 11.9k views

Hello All

I have been stuck in this process for a while now, so I have the project ready to and are able to run it in port 3000 (I need to do rails s every time)

My question is how do I move from visiting ip:3000 to simply visiting ip? (still figuring out the dns thing)

I have tried to restart the project and test with the default home page and only devise gem, and any changes I made to the index.html.erb will show up, but the pages I added in with devise will not be there.

There was a time I played with nginx to see if it’s its problem but changing what it listens to doesn’t seem to help?

Thank you

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
4 answers

There are a few ways you could accomplish this. Two of the most popular are using Passenger with Apache and setting up an Nginx reverse proxy in front of it. Check out these tutorials for a run down on both options:

by Juraj Kostolanský
Deploy your Rails application with Passenger and Nginx on Ubuntu 14.04.

Well I started in one click install, so it comes with Nginx and Unicorn and I was trying to look for advice on fixing the problem by configuring the two.

Those tutorials are tutorials starting from a blank ubuntu droplet, is there a way to convert my current droplet to a blank one and keeping all the snapshots or I have to get a new droplets?
Update:I’m rebuilding from image, but still would like to know how to go from one click install rails app to deployment though

  • If you are using the “One-Click” app, you’ll want to check out this tutorial:

    It should give you all the info you need. You should start and stop the app using the Unicorn service, service unicorn restart It will run the app on port 8080 on the localhost. This is defined in /home/unicorn/unicorn.conf Nginx is running as a reverse proxy and will make it available externally on port 80.

  • Yeah that was the tutorial I followed and it only response to changes to existing files. I did install devise but it only worked on port 3000 and not able to get it working on default port.

I have this same problem. My devise isn’t working on my one 1-click ruby image either.

I ended up starting from a clean Ubuntu server and set it up by following the nginx and phusion passange tutorial.