Installing Ruby 2.18 using rvm.
NOTE: by default ruby 1.8.7 is installed on centos 6.
Step 1. Install the required packages
# yumStep 2. Install the latest version of RVMinstall gcc-c++ patch readline readline-devel zlib zlib-devel # yuminstall libyaml-devel libffi-devel openssl-devel make # yuminstall bzip2 autoconf automake libtool bison iconv-devel sqlite-devel
# curl -Lget.rvm.io | bash -sstable
# cd tar -xzvf /usr/local/rvm/archives/rvm-1.26.11.tgz
# cd /usr/local/rvm/archives/rvm-1.26.11/binscripts
# ./rvm-installer
Step 3. Setup the RVM Environment
# source/etc/profile.d/rvm.sh
Step 4. Install ruby
# rvm install2.1.8
Step 5. Configure the Default version of Ruby
#rvm use 2.1.8 --default Using /usr/local/rvm/gems/ruby-2.1.8
Step 6. Check the current version of Ruby
# ruby --version ruby 2.1.8p440 (2015-12-16 revision 53160) [x86_64-linux]
Install Rails
#gem install rails -V
Create a Test Application (Optional) to verify that Rails is working properly
NOTE: After running the rails server --binding= the following error might pop up " There was an error while trying to load the gem 'uglifier'" if you see this error you will need to install nodejs. Run the following commands to install nodejs
curl -sL https://rpm.nodesource.com/setup | bash -
yum install -y nodejs
npm install -g express-generator
npm -g install npm@latest
NOTE: After running the rails server --binding=
curl -sL https://rpm.nodesource.com/setup | bash -
yum install -y nodejs
npm install -g express-generator
npm -g install npm@latest
cd ~ rails new testapp
The move into the applications directory
# cd testapp
Create the sqlite3 database:
rake db:create
http://server ip address:3000
No comments:
Post a Comment