Ruby on Rails is one of the most popular web development framework, it’s build upon Ruby Programming Language, and it’s the hottest web development stack currently.
Rbenv
Rbenv is a shell script tools created by Sam Stephenson. It’s used for groom your app’s Ruby environment.Use rbenv can pick a Ruby version for your application and guarantee that your development environment matches production.
rbenv works by inserting a directory of shims at the front of your PATH:
~/.rbenv/shims:/usr/local/bin:/usr/bin:/bin
Through a process called rehashing, rbenv maintains shims in that directory to match every Ruby command across every installed version of Ruby—irb, gem, rake, rails, ruby, and so on.
CentOS
CentOS is derived from Red Hat Enterprise Linux. The target users of these distributions are usually businesses, which require their systems to be running the most stable way for a long time.So we are going to use CentOS 6.5 running our applications.
Step One – Install dependencies
Before, installing any package, it’s always recommended to update package repository cache use yum.
sudo yum update
Now,in order to get necessary development tools and dependencies, run the following:
Add rbenv init to your shell to enable rbenv shims and autocompletion.
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
Ruby-build is a Rbenv plugin which provides the rbenv install command that simplifies the process of installing new Ruby versions. Install rbenv-build:
Ruby on Rails need a JavaScript runtime support. It use execjs gem which can automatically picks the best runtime available to evaluate your JavaScript program, then returns the result to you as a Ruby object.
ExecJS supports these runtimes:
therubyracer – Google V8 embedded within Ruby
therubyrhino – Mozilla Rhino embedded within JRuby
Node.js
Apple JavaScriptCore – Included with Mac OS X
Microsoft Windows Script Host (JScript)
So we can use therubyracer gem or Node.js in with our CentOS and MRI Ruby. In this guide we use Nodejs as JavaScript runtime.
Extra Packages for Enterprise Linux (or EPEL) is a Fedora Special Interest Group that creates, maintains, and manages a high quality set of additional packages for Enterprise Linux, including, but not limited to, Red Hat Enterprise Linux (RHEL), CentOS and Scientific Linux (SL), Oracle Enterprise Linux(OEL).