Ruby on Rails application deployment on local computer with postgresql - ruby-on-rails

I am new to Ruby on Rails. We have developed an small application with Postgresql. Now we have to deploy it. But when i searched over internet i found lot of suggestion is to deploy them on Heroku or some premium servers. where we are not in a position now to deploy it on cloud.
How can i deploy the application on local computer? Is this similar to setting up a development environment?
Any link or lead will be much appreciated!

I hope you have your application already running on your development environment.
Create another database in your postgres, to use it for production in local system. And make necessary changes in database.yml
I feel passenger is the easiest way to deploy application, you can follow the steps in this link https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-passenger-and-apache-on-ubuntu-14-04 to deploy your app.

Heroku also have free deployment for few application. You can use heroku.
There are some more option like AWS, Digital Ocean. AWS is also free for one year.
Yes setting up a development environment is like set up your environment. But best practice is use a deployment automation like capistrano.

You can run it in a production environment and make it public. I had written a blog post regarding this.
Please check here
ps - Make sure your system is up for public access and i am hoping that this is for test purpose only and to show it to your clients.

Yes, it would be fairly similar to setting up your development environment.
In addition to setting up Passenger as described in the Digital Ocean post from Rajuk's answer, I use Capistrano for deployment to my Ubuntu servers. You can set up the Capistrano deployment configuration to deploy to any machine.
The possible configuration variables are too numerous to address here without further details about your specific situation.
Check out Railscast #335 Deploying to a VPS where Ryan talks about deploying to a Linux machine (a cloud VPS in this case) with Capistrano.

Related

What's Docker easiest way to deploy Rails on production?

I'm interested in Docker as it creates a neat way of setting up an application environment.
EDIT : I'm on Digital Ocean Droplet created with their Docker 1 click Application.
Apparently there isn't a proper way to deploy a Rails application to production, or at least I haven't found it. The setup seems much more complicated then setting up the server from scratch and using Capistrano. I tried using Heroku but it doesn't entirely support Docker.
Is there any good guideline on how to setup Docker to deploy a simple Rails application on a production server?
I read/watched already this references:
The Quickstart: Docker Compose and Rails is ok for development, but then Using Compose in production is too rough and superficial.
The Docker for DevOps course: From development to pro
way too complex, but is the only that at the end tells you how to deploy Rails on Digital Ocean. Anyway there must be an easier way.
Deploying Your Docker Rails App
is just for Heroku.
Getting to know Centurion
does anyone use Centurion to deploy?
Docker + Capistrano = Warp Speed
a bit buggy and outdated.
Running multiple web applications on a Docker host with Apache
the right approach, shame is not for Rails..

Using capistrano to deploy same project from different machines

We have a team of 2 people writing Rails application. We use DigitalOcean as of VPS and capistrano to deploy it.
But the capistrano deployment scripts are only on one of our two machines.
Is it possible to set up capistrano on the second machine to deploy same project also from it? If yes, how this looks like?
P.S. This might be very easy like adding some SSH keys and running cap production deploy from second machine as the remote VPS has whole infrastructure set up. But we can't take the risk on production system.
There are a couple ways of doing this:
Commit your Cap scripts to the repository alongside your code (this is how I tend to do it; it works well with Ruby on Rails, the config structure matches). Anyone who wants to deploy just needs their SSH key set up on the server.
Create another repository with the deploy scripts; similarly to above, you need SSH keys.
Use a CI server to deploy.
Come up with something else more esoteric. Capistrano is pretty flexible.
Where I work, we generally just add Capistrano to a Rails app's Gemfile, and anyone who checks it out can deploy it to any server to which they have access. Developer SSH keys are added to the servers for this purpose.
Good luck!

Deploying Rails github with a SharedServer

I am trying to deploy a Rails application online. My host right now is dream host. Although i am not to sure how to deploy my apps. At the moment i am on a shared server, but i am considering upgrading to a VPS, but the questions remains! Do i need Git hub or not. If i need to have git hub to make it private do i have to pay or an alternative exist.
What I meant by not to sure on how to deploy rails is that I have a localhost provided with webrick and with database.yml settup otherwise everything else is dark for me.
You can use capistrano to deploy you application to shared host or VPS via SSH.
https://help.github.com/articles/deploying-with-capistrano.

What to do after Rails deployment?

I am am a newbie in Ruby on Rails development and I am learning this fantastic framework fast and easy. The only problem (which is a big one) is how to deploy.
I have tried a Linode StackScript which installs Ruby, Rails, Passenger and Nginx and I have made a "cap deploy" and all files was sent to the server but how on earth do I get this public. When I visit my website (IP) it seems to be down or not responding. Is there anything I need to do after deployment to make my app available to the web?
Thankful for all help, I really want to slay the deployment beast!
For ease of deployment, and scalability, have you looked at Heroku instead of hosting your own server?
That would make the process of deploying as simple as git push heroku

How do you deploy your Rails application?

Do you upload your rail application to your host via FTP first?
I'm currently using Passenger and Capistrano. If I do "cap deploy" in my local machine then I think Capistrano should upload my rail application to my host, right?
Someone from my host is saying that I need to run "cap deploy" in server. I think it doesn't make sense.
You should be able to run cap deloy on your local machine and that should get the current version of your software to the server. However, you need to set up first how this is supposed to happen. I for example use Git to manage my code and also use it to get my software on the server. However, you could also use SVN or FTP if you prefer that. If you google for Capistrano together with the Software youbeant to transfer the code with and maybe even your hosting providers name, you probably will find a decent step by step explanation. For me John Numemaker's post on deploying with Capistrano and Git on Dreamhost really helped: http://railstips.org/blog/archives/2008/12/14/deploying-rails-on-dreamhost-with-passenger/
As an alternative you also might want to check out heroku.com. Their smallest offer is free and enough for most projects. The deployment process is so easy a monkey could deploy a Rails app on their platform. I generally can only recommend heroku.

Resources