Toll free (US) : +1 (888) 838-3532 | NYC: +1 (646) 491-6866

• download the ruby source, then unzip, untar, configure and install

[[email protected] ~]#wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.bz2

[[email protected] ~]#tar xjvf ruby-1.9.3-p194.tar.bz2

[[email protected] ~]#cd ruby-1.9.3-p194

[[email protected] ruby-1.9.3-p194]#./configure

[[email protected] ruby-1.9.3-p194]#make

[[email protected] ruby-1.9.3-p194]#make install

• check the ruby version

[[email protected] ~]#ruby -v

• download ruby gems and install

[[email protected] ~]#wget http://rubyforge.org/frs/download.php/76073/rubygems-1.8.24.tgz

[[email protected] ~]#tar xzvf rubygems-1.8.24.tgz

[[email protected] ~]#cd rubygems-1.8.24

[[email protected] rubygems-1.8.24]#ruby setup.rb

• installing Rails by using ruby gems (gem is a package manager)

[[email protected] ~]#gem install rails –include-dependencies

• creating an application

[[email protected] ~]#rails new prv —for creating prv application and rails is a binary command

inside this application root scripts folder, check the database.yml file for which database this application is using.

• running the application

[[email protected] prv]#rails server

inside that app directory run rails server command, it may give some error like, in this case i got sqlite3 is not found.

sqlite3 database it used by the app and it is not installed so, we need to install sqlite2.

[[email protected] prv]#yum install sqlite-devel

After, while running the app I got the error like

—-

“/usr/lib/ruby/gems/1.8/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in `autodetect’: Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)”

so we ve to install java script runner ie add a gem in Gemfile of that app

like gem ‘therubyracer’ or gem ‘execJS’ , here therubyracer and execJS are supports the java scripts.

after adding javascript gem in Gemfile

do bundle install it ll read the Gemfile and installs all gems which are mentioned in that file,

then run “rails server” in that app root ,

[[email protected] prv]#rails server

=> Booting WEBrick

=> Rails 3.1.0 application starting in development on http://0.0.0.0:3000

=> Call with -d to detach

=> Ctrl-C to shutdown server

[2012-09-07 17:09:45] INFO WEBrick 1.3.1

[2012-09-07 17:09:45] INFO ruby 1.8.7 (2010-06-23) [i386-linux]

[2012-09-07 17:09:45] INFO WEBrick::HTTPServer#start: pid=3049 port=3000

Go to the browser and You can see the Rails welcom page
http://<server ip/localhost>:3000

Contact RailsCarma | Global Rails Company