Ruby On rails Installation for developers
To install ruby and start rolling on rails is as simple as the following steps:
yum install ruby ruby-devel
tar -xzf rubygems-0.9.0.tgz
- gem install mongrel
- rails mytest
this will create the directory structure and the basic rails framework where you can write your own controllers, model and views.
Starting the server:
Once Mongrel has been installed you can start it up to host your project by executing the following, from the root of your application:
skx@host:~/Rails/mytest$ mongrel_rails start -d -e production -a 127.0.0.1 -p 3000
Here we’ve used several arguments (for an overview of more options run “mogrel_rails start -t“) here is a quick explanation of what they mean:
- To detach and run in the background
- -e production
- To run the application in “production” mode.
- -a 127.0.0.1
- To bind to the localhost only.
- -p 3000
- To listen upon port 3000.
Note: you don’t need to start the server as root, since you’re binding to a “non privileged” port.
All being well you should receive no errors and browsing at http://localhost:3000 should show you your applications front page.
To stop the server you may run:
skx@host:~/Rails/mytests$ mongrel_rails stop Sending TERM to Mongrel at PID 9698...Done.