Installing Ruby On Rails in Fedora

After noticing the struggle to install Ruby on Rail in Fedora by some of my dear fellows near me and having a lot of push talk by our branch manager I am going to post the way that I used to install Ruby on Rails in Fedora. Of course you can find help online, but none of them are straight forward and many time you can fall in a situation like “now what to do” if you are a novice in ROR like me. (Actually I know the installation only. hehe…). Hope you find it useful.

# yum install rubygem-rails ruby-mysql
===========================================================================================
 Package                                     Arch                        Version
===========================================================================================
Installing:
 ruby-mysql                                  i686                        2.8-4.fc12
 rubygem-rails                               noarch                      1:2.3.4-2.fc12
Installing for dependencies:
 ruby-irb                                    i686                        1.8.6.399-6.fc12
 ruby-rdoc                                   i686                        1.8.6.399-6.fc12
 rubygem-actionmailer                        noarch                      1:2.3.4-2.fc12
 rubygem-actionpack                          noarch                      1:2.3.4-3.fc12
 rubygem-activerecord                        noarch                      1:2.3.4-2.fc12
 rubygem-activeresource                      noarch                      1:2.3.4-2.fc12
 rubygem-activesupport                       noarch                      1:2.3.4-2.fc12
 rubygem-rack                                noarch                      1:1.0.0-3.fc12
 rubygem-rake                                noarch                      0.8.7-2.fc12
 rubygems                                    noarch                      1.3.7-1.fc12      

Transaction Summary
=============================================================================================
Install      12 Package(s)

# yum install rubygem-sqlite3-ruby

# yum install rubygem-mongrel*

# yum install rubygem-json
==========================================================================================
 Package                                 Arch                         Version
==========================================================================================
Installing:
 rubygem-json                            i686                         1.1.7-3.fc12
Installing for dependencies:
 ruby-atk                                i686                         0.19.4-1.fc12
 ruby-cairo                              i686                         1.10.0-3.fc12
 ruby-gdkpixbuf2                         i686                         0.19.4-1.fc12
 ruby-glib2                              i686                         0.19.4-1.fc12
 ruby-gtk2                               i686                         0.19.4-1.fc12
 ruby-pango                              i686                         0.19.4-1.fc12
 rubygem-cairo                           i686                         1.10.0-3.fc12          

Transaction Summary
===========================================================================================
Install       8 Package(s)

# yum install rubygem-git

(the following will not be needed if first command dont install these)
# yum install rubygem-actionmailer rubygem-activerecord rubygem-activesupport 

APACHE CONFIGURATION:
---------------------------
# yum install ruby-devel
# gem install passenger
# passenger-install-apache2-module

This will create an .so file in: /usr/lib/ruby/gems/1.8/gems/passenger-X.X.X/ext/apache2/mod_passenger.so and the shell will tell you to add some code in httpd.conf and create virtual host.
e.g.
Edit the httpd.conf and at the eld of LoadModules section add the lines:

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.5/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.5
PassengerRuby /usr/bin/ruby

VHOST:

   ServerName relvurvey.jlk
   DocumentRoot /opt/www/relativesolutions-survey/public
   RailsEnv production

## Don't forget to edit the /etc/hosts file to reflect your newly created domain in conf

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++ Troubleshooting +++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

1) Application error....
The best way to locake the problem is to run the dispach.cgi. This will detect the problems that is causing problem running the application.
# cd to/public
# ./dispach.cgi
	Error A)
		/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- pdfkit (LoadError)
		from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
		from ./../config/environment.rb:12
		from ./dispatch.cgi:3:in `require'
		from ./dispatch.cgi:3
	Sol: gem install pdfkit

2) Internal Server Eroor...:
   >> Your log file may not be writable by the web server. (log/*)
   >> Your database configuration may not be correct. (config/database.yml)
   >> May be you need to restart the apache server if you are in middle of any erver configuration. But have a try with it anyway.
Advertisement
  1. #1 by tohin on June 17, 2011 - 1:48 pm

    Cool !

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

Follow

Get every new post delivered to your Inbox.