RoR installation from source and deploying a test app

Download the ruby source, then unzip, untar, configure and install

[root@railstestwebmin ~]#wget

[root@railstestwebmin ~]#tar xjvf ruby-1.9.3-p194.tar.bz2

[root@railstestwebmin ~]#cd ruby-1.9.3-p194

[root@railstestwebmin ruby-1.9.3-p194]#./configure

[root@railstestwebmin ruby-1.9.3-p194]#make

[root@railstestwebmin ruby-1.9.3-p194]#make install

Check the ruby version

[root@railstestwebmin ~]#ruby -v

Download ruby gems and install

[root@railstestwebmin ~]#wget

[root@railstestwebmin ~]#tar xzvf rubygems-1.8.24.tgz

[root@railstestwebmin ~]#cd rubygems-1.8.24

[root@railstestwebmin rubygems-1.8.24]#ruby setup.rb

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

[root@railstestwebmin ~]#gem install rails –include-dependencies

Creating an application

[root@railstestwebmin ~]#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

[root@railstestwebmin 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.

[root@railstestwebmin 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 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 ,

[root@railstestwebmin prv]#rails server

=> Booting WEBrick

=> Rails 3.1.0 application starting in development on

=> 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



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s