PigRider Blogs

Sign In
HTML CSS Javascript Ruby on Rails C++ Java Python SQL Git Linux Others All

Setup Ruby on Rails environment in Centos with Apache and MySQL

[Author: Dingyu]   [Tue, 2016-07-12, 16:52]   [1698 views]

Ruby on Rails Linux

Install RVM (Ruby Version Manager)
sudo curl -sSL https://get.rvm.io | bash -s stable
rvm requirements


Install Ruby
rvm install 2.0.0
rvm use 2.0.0 --default


Install Rails
gem install rails


Install MySQL
sudo yum install mysql-server mysql-devel
sudo chkconfig mysqld on
sudo service mysqld restart


Setup MySQL Accounts
http://dev.mysql.com/doc/refman/5.1/en/adding-users.html


* (Recommend) A better way to install Apache and Passenger may be found in the Passenger website:
https://www.phusionpassenger.com/

(Not Recommend) Install Apache
sudo yum install httpd
sudo chkconfig httpd on
sudo service httpd restart

(Not Recommend) Install Phusion Passenger
gem install passenger
sudo yum install curl-devel httpd-devel
passenger-install-apache2-module
modified the file: /etc/httpd/conf/httpd.conf
sudo service httpd restart


Optional
for using Git:
sudo yum install git

for using Paperclip gem:
sudo yum install ImageMagick

for using Solr search:
Install or upgrade to Solr 4.10 with Jetty in CentOS 6.6


Reference
https://www.digitalocean.com/community/tutorials/how-to-setup-a-rails-4-app-with-apache-and-passenger-on-centos-6