[Install ruby and rubygems]
First we need to install ruby and its package system rubygems:
Next install rails via rubygems:
gem will help us manage all the dependencies and download them automatically.
(Notes: if you execute the above command without being root (e.g. without sudo), gem will install rails in the home directory of the current user. Usually the directory is named after “.gem”, you probably need to manually add rails and rake bin directory to your PATH before you could use them, that may not be what you exactly want.)
next install sqlite database since it’s rails’s default database:
rails supports a lot of modern databases, but here we will only use sqlite for simplicity.
[Test rails installation]
All right, that’s it, pretty simple, isn’t it? Next, let’s make sure it exactly works as we expected.
test ruby, rubygems, rails and rake installation, make sure all these tools are successfully installed:
$ gem -v
$ rails -v
$ rake --version
create a rails testapp with preconfiguration for sqlite 3 database:
next start the web server, mongrel will be booted since we have mongrel installed before, otherwise webrick will be used:
as can be seen from the console output below, the default listening port is 3000:
=> Booting Mongrel
=> Rails 2.3.2 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
finally fire our favorite browser to http://server-domain-or-ip:3000/ to see the rails “welcome abroad” page, and we’re done:
- [2009-6-30] Redmine on Archlinux