とてもお急ぎの場合。
sudo aptitude install rails
gemを使ってもいい場合。(僕の場合はこっちかな)
$ sudo aptitude install ruby ruby-dev rubygems libssl-ruby $ sudo aptitude install mysql-server libmysql-ruby $ gem install rails $ sudo ln -s /var/lib/gems/1.8/bin/rails /usr/bin/rails
最後の" ln -s "はなんか不自然なんだけど。回避する良い方法があるのかもしれない。
インストールできたら実験する。
$ cd www $ rails demo $ cd demo $ rails scripts/server
WEBRickを80番であげたいときは
任意のIPや任意のポートを指定する。これで、リモートサーバーでも安心
$ ruby scripts/server -b 192.168.11.2 -p 8080
通常80番はRoot権限を要求されると思う。localhost以外での開発の場合はIP指定が便利。
railsのWEBickのつかいかた
rails scripts/server --help Usage: ruby server [options] -p, --port=port Runs Rails on the specified port. Default: 3000 -b, --binding=ip Binds Rails to the specified ip. Default: 127.0.0.1 -e, --environment=name Specifies the environment to run this server under (test/development/production). Default: development -m, --mime-types=filename Specifies an Apache style mime.types configuration file to be used for mime types Default: none -d, --daemon Make Rails run as a Daemon (only works if fork is available -- meaning on *nix). -u, --debugger Enable ruby-debugging for the server. -c, --charset=charset Set default charset for output. Default: UTF-8 -h, --help Show this help message.