Ruby on Rails and rubygems install on CentOS
Ruby on Rails install on CentOS
Once you have the development tools package installed. You can go ahead and install Ruby on Rails. The main ruby packages and dependencies will be installed using the ‘yum’ package manager, but rubygems will be installed from source. Rubygems is not readily available through the repositories in yum.
Install ruby.
Main Ruby on Rails packages can be installed using the below method.
sudo yum install ruby ruby-devel ruby-irb ruby-rdoc ruby-ri
Once done, we can have a look at the Ruby version.
$ ruby -v
ruby 1.8.8dev (2010-02-11) [i686-linux]
Installing rubygems for Rails installation.
Download from: http://rubyforge.org/projects/rubygems/
wget http://rubyforge.org/frs/download.php/70696/rubygems-1.3.7.tgz
Now unpack it and move into the newly created folder.
Now we can go through the simple process of compiling it:
Once done, we can check the gem version with a:
NOTE:
http://rubygems.org is now the default source for downloading gems.
* `gem` commands
* `gem install` and `gem fetch` now report alternate platforms when a matching one couldn’t be found.
Creating a Rewrite for Ruby on Rails Application in cPanel
Ruby on Rails uses its own server, users visiting your Ruby on Rails application will need to be redirected to the appropriate port.
Because Ruby on Rails uses its own server, users visiting your website (and subsequently your Ruby on Rails application) will need to be redirected to the appropriate port.
Ruby does not respond on the standard HTTP port number, 80. Thus, visitors would need to specify the port number with the domain — for example, example.com:12001.
To configure a rewrite for Ruby on Rails Application in cPanel
1. Log into cPanel.
2. Navigate to the Software/Services section of your cPanel interface.
3. Click the Ruby on Rails icon. This step will open the Ruby on Rails management interface.
4. Click the Create Rewrite button corresponding to the appropriate application in the Create A Rewrite table.
Limit the number of Rails applications in Cpanel Server
You can limit the number of Rails applications your customers can install.
To do this in WHM, go to Modify an Account, click the domain name you wish to limit, and in the Max Mongrel Instances (Ruby on Rails) box, specify the desired maximum number of applications.
Creating a Ruby on Rails Application in Cpanel Server
Ruby on Rails runs on its own server so the setup requires a little extra work.
1. Log into cPanel.
2. Navigate to the Software/Services section of your cPanel interface.
3. Click the Ruby on Rails icon.
* This step will open the Ruby on Rails management interface.
4. Specify your application’s name in the App Name field.
* PICK Remember: To set your application to load when the server is booted, click the Load on Boot? check box.
5. Assign the application path in the Application Path field.
* note Note: If you set an application path in your public_html/ directory, your source code and configuration files can be viewed by anyone on the web.
6. Use the Environment drop-down menu to select the type of Ruby on Rails environment you wish to run.
7. Click Create.