Notes on Setting up a Rails Server in 2015 (Ubuntu 14.04, Nginx, Passenger, Ruby 2.1, PostgreSQL) Ruby in Production: Lessons Learned. Ruby in Production: Lessons Learned Having deployed a variety of Ruby apps (Rails and non-Rails) over the course of many years, here are some lessons I’ve learned to keep things afloat.
Tools like Mina and Capistrano already do most of these (more on that further down), but its good to have a first-hand understanding of what needs to happen. All these instructions are available a ready-to-use repo:ruby-deploy-kickstartRuby/Rails deployment template with .env, Foreman, Ansible, Docker & Vagrant. Dependencies: Use nodejs+execjs for asset compilation, instead of therubyracer+libv8. This will make deployments much faster. 1. Regular dependencies: git, development tools (build-essential in apt or base-devel in yum)NodeJS. 2.
If you’re on Debian systems, prefer using BrightBox’s Ruby Packages. Why not RVM or rbenv? 3. Create a separate user and group for your app. 4. The repository should not be checked out at the base of /home/myapp. 5. . # /etc/gemrcgem: --no-ri --no-rdoc. Rax_rails_tutorial/server_tutorial.md at master · rackerlabs/rax_rails_tutorial. How to Deploy a Rails 4 App With Git and Capistrano // Rob McLarty. I think the two key aspects of any deployment process are speed and consistency.
Speed means you can iterate and fix bugs fast and keep your production code in sync with your development code. Consistency means you know it's going to do the same thing every time so you're not afraid to actually do it and stay up to date. Using a revision control system like Git along with automated deployment recipes with Capistrano satisfies these criteria easily and gives your Rails app a little more oomph. This article assumes you're using a setup like I outlined in my article on how to setup a production server. That is, a Unix server with SSH access using Phusion Passenger and Apache serving a Ruby on Rails app.
Knowing is half the battle Back when I was first learning Rails as a wide-eyed noob, I had no idea how to get from this thing that was working on my dev machine onto a real web server that other people could actual use. Well, there is and there isn't. Your App rake db:migrate rails s or Capify. Setting up a production server with ruby on rails (Deployment included) Part 1. Setting up a production server with ruby on rails (Deployment included) Part 1 When first creating a ruby on rails application I thought about going with a service like heroku.
Yes heroku is great since they manage your server but the prices and addons can get very expensive. If you’re a developer who is not scared to dive deep into the command line then look no further. In this tutorial I am going to share with you all how to setup your very own production server with rails 3. What well be using Ubuntu 10.04RVMgitRuby 1.9.3Rails 3.2.4Mysql / Postgresql What you’ll need Linode VpsRackspace Cloud Setup server Now since you are aware of the tools that we’ll be using, lets begin setting up our server from scratch.
Open your terminal and type root@ your ip address for your server. Now that your logged into the server lets create a new user so that you are not logged in as root for everything. Now that our user account is setup we need to allow our user to install programs but not as root. Deploying Rails Apps using Capistrano (Part 3) Prerequisite: Deploying Rails Apps using Capistrano (Part 2) Table of Contents 4 The Rails App For the sake of the tutorial, I created a public repository on my Github account that contains the Rails app I’ll be deploying to the server we’ve been working on.
Start by adding the following line to your Gemfile, then run bundle install to install capistrano. gem 'capistrano-rvm', group: :development gem 'capistrano-rails', group: :development bundle exec cap install.