What are the best methods for deploying Rails to overcome environmental differences?

I am working on Ubuntu developing a Rails application for my church. We are using a hosted VPS on Ubuntu as well. I am using Capistrano to deploy periodic updates. However, it is inevitable that an application running in my local box always has a few issues after deploying to the host, most likely due to the environment being different.

What are some techniques / techniques to make deployment easier, so what is tested and works locally also probably works on the host. (I've already adopted a vendor-all approach.)

My first thought is to develop / run in a local VPS image that will eventually be deployed (virtual device). Does anyone do this?

What are others doing to minimize the problems caused by environmental differences? Which hosts provide the best deployment options?

+2


source to share


4 answers


As much as possible, make sure you are using the same Ruby version, the same Rails version, the same database setup, and the same as everything else. The more differences between your live setup and your development setup, the more problems you will face.



0


source


Try setting up a scripting environment that mimics your production environment as much as possible. I actually use some of my servers like this, creating a subdomain (staged.mydomain.com) to check that the gems are the correct version and so.

I am also using user READ-ONLY for testing with live and live data at this stage of the installation.



This approach helps us make sure that the new deployment will perform very well by first solving the problems.

It would be good to know what problems you often encounter in order to try to find a way to reduce their appearance.

+1


source


Well, you actually answered your own question.

If you cannot deploy to a staging environment on a production box, you should try and mirror this on your machine. Then you can check it with programs like VMWare etc.

In my experience, this is only necessary in truly critical situations. If your Ruby / Rails (the gem versions you can specify in your environment) are the same, you should have no problem deploying your Rails application.

Indeed, it would be good to know what problems you are facing, so we can hopefully provide you with a more adequate solution.

0


source


Keep in mind that most Rails developers run OS X and deploy to a UNIX server, and we never have a problem with this.

The versions of raby, rails, mysql, etc. must be the same, of course.

0


source







All Articles