Ruby on Rails Admin

Introduction

This procedure describes how to build Ruby on Rails on a FreeBSD system.

Procedure

  1. Install Ruby on Rails (it's a long build process with many dependencies):
    
    % cd /usr/ports/www/rubygem-rails
    % sudo make install clean
    
    
  2. The preferred deployment setup for Rails is Phusion Passenger aka mod_rails. It's a module for Apache that automatically manages the back end.
    
    % cd /usr/ports/www/rubygem-passenger
    % sudo make install clean
    
    
  3. Install the Node-JS port:
    
    % cd /usr/ports/www/node
    % sudo make install clean
    
    
  4. Install the SQLite Ruby gem:
    
    % cd /usr/ports/www/rubygem-sqlite3
    % sudo make install clean
    
    
  5. Edit Apache's httpd.conf:
    
    #####################################################################
    
    Please edit your Apache configuration file, and add these lines:
    
       LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.13/ext/apache2/mod_passenger.so
       PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.13
       PassengerRuby /usr/local/bin/ruby18
    
    After you restart Apache, you are ready to deploy any number of Ruby on Rails
    applications on Apache, without any further Ruby on Rails-specific
    configuration!
    
    #####################################################################
    
    
  6. I haven't quite parsed this one yet:
    
    after that add Visrual host in apache with point “../public”  of your project, restart apache and going to be happy :)
    
    
  7. Update the 'gem', or module, files to the freshest versions. They're located in /usr/local/lib/ruby/gems/1.8/gems/.
    
    % sudo gem update
    
    
  8. Tests
    
    % rails --version
    Rails 3.2.6
    
    % gem list
    
    *** LOCAL GEMS ***
    
    abstract (1.0.0)
    actionmailer (3.2.3, 3.2.1)
    actionpack (3.2.3, 3.2.1)
    activemodel (3.2.3, 3.2.1)
    activerecord (3.2.3, 3.2.1)
    activeresource (3.2.3, 3.2.1)
    activesupport (3.2.3, 3.2.1)
    arel (3.0.2, 3.0.0)
    bcrypt-ruby (3.0.1)
    builder (3.0.0)
    bundler (1.1.3, 1.0.22)
    cgi_multipart_eof_fix (2.5.0)
    coffee-rails (3.2.2, 3.2.1)
    coffee-script (2.2.0)
    coffee-script-source (1.3.1, 1.2.0)
    daemon_controller (1.0.0)
    daemons (1.1.8, 1.1.4)
    erubis (2.7.0)
    execjs (1.3.1, 1.3.0, 1.2.13)
    fastthread (1.0.7)
    gem_plugin (0.2.3)
    hike (1.2.1)
    i18n (0.6.0)
    journey (1.0.3, 1.0.1)
    jquery-rails (2.0.2, 1.0.19)
    json (1.6.6, 1.6.5)
    json_pure (1.6.6, 1.6.5)
    mail (2.4.4, 2.4.1)
    mime-types (1.18, 1.17.2)
    mongrel (1.1.5)
    multi_json (1.3.2, 1.0.4)
    passenger (3.0.12, 3.0.11)
    pg (0.13.2, 0.13.0)
    polyglot (0.3.3)
    rack (1.4.1)
    rack-cache (1.2, 1.1)
    rack-mount (0.8.3)
    rack-ssl (1.3.2)
    rack-test (0.6.1)
    rails (3.2.3, 3.2.1)
    railties (3.2.3, 3.2.1)
    rake (0.9.2.2, 0.8.7)
    rake-compiler (0.8.1, 0.8.0)
    rdoc (3.12)
    sass (3.1.16, 3.1.13)
    sass-rails (3.2.5, 3.2.1)
    sprockets (2.4.1, 2.4.0, 2.1.2)
    spruz (0.2.13)
    sqlite3 (1.3.5)
    thor (0.14.6)
    tilt (1.3.3)
    treetop (1.4.10)
    tzinfo (0.3.33, 0.3.31)
    uglifier (1.2.4, 1.2.2)
    
    

References

  1. http://rubyonrails.org/deploy
  2. http://www.modrails.com/
  3. http://howtobsd.com/software/installing-ruby-on-rails-on-freebsd.html