Ruby-rails: Difference between revisions
From Bashlinux
Jump to navigationJump to search
Content deleted Content added
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
__NOTOC__ |
__NOTOC__ |
||
= |
= Ruby: Rails = |
||
== Installation == |
|||
==== Debian ==== |
|||
As root issue the following command: |
As root issue the following command: |
||
| Line 17: | Line 18: | ||
=== Fedora === |
==== Fedora ==== |
||
Its very easy, `rubygem-rails` must provide all the needed packages and dependencies |
Its very easy, `rubygem-rails` must provide all the needed packages and dependencies |
||
| Line 25: | Line 26: | ||
= Create a Rails Application = |
== Create a Rails Application == |
||
# Set a location to deploy rails applications (eg. `/var/rails`) |
# Set a location to deploy rails applications (eg. `/var/rails`) |
||
# Create Rails application |
# Create Rails application |
||
| Line 36: | Line 37: | ||
= Publish a Rail Application = |
== Publish a Rail Application == |
||
Assuming the name of the Rail Application is `newrail` and the location for all new Rail Applications is `/var/rails`, thus a Rail Application can be published in 2 ways: |
Assuming the name of the Rail Application is `newrail` and the location for all new Rail Applications is `/var/rails`, thus a Rail Application can be published in 2 ways: |
||
Revision as of 08:36, 4 March 2010
Ruby: Rails
Installation
Debian
As root issue the following command:
gem install rails
#!wiki note '''Binary gems directory is not added automatically on `$PATH`''' In order to run gem binaries available on `bin` folder, the location `/var/lib/gems/1.8/bin` must be added as described in `/usr/share/docs/rubygems1.8/README.Debian`.
Fedora
Its very easy, `rubygem-rails` must provide all the needed packages and dependencies
yum install rubygem-rails
Create a Rails Application
- Set a location to deploy rails applications (eg. `/var/rails`)
- Create Rails application
mkdir -p /var/rails cd /var/rails rails newrail
Publish a Rail Application
Assuming the name of the Rail Application is `newrail` and the location for all new Rail Applications is `/var/rails`, thus a Rail Application can be published in 2 ways:
- Via Builtin Webserver, called WEBrick by running `/script/server` located in the folder where it was created.
cd /var/rails/newrail/script ./server &
- Via Apache Web Server by setting the proper `DocumentRoot` varible with the location of the `public` folder in the Rail Application
DocumentRoot /var/rails/newrails/public
<Directory /var/rails/newrails/public>
Options ExecCGI FollowSymLinks
AddHandler cgi-script .cgi
AllowOverride all
Order allow,deny
Allow from all
</Directory>
...