个人工具

UbuntuHelp:RubyOnRails

来自Ubuntu中文

Wikibot讨论 | 贡献2008年5月9日 (五) 19:19的版本

跳转至: 导航, 搜索

Intro

These instructions are for Ubuntu 8.04 LTS (hardy). We use gems because of what ReinH put best... <ReinH> Let gems manage your rails package otherwise gem and apt-get will start fighting like Spock and Captain Kirk in Amock Time. If you haven't seen that episode, trust me: you don't want that. ;

Installation

sudo apt-get install ruby-full build-essential apache2 apache2-mpm-prefork apache2-prefork-dev

The link below is to a specific version of rubygems. If you go to http://rubyforge.org/frs/?group_id=126 you'll get a list of all of the versions, most recent on top.

wget http://rubyforge.org/frs/download.php/34638/rubygems-1.1.0.tgz
tar xzvf rubygems-1.1.0.tgz
cd rubygems-1.1.0
sudo ruby setup.rb
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
sudo gem update --system
sudo gem install rails
sudo gem install passenger
sudo passenger-install-apache2-module

Add these lines to /etc/apache2/apache2.conf:

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-1.0.3/ext/apache2/mod_passenger.so
RailsSpawnServer /usr/lib/ruby/gems/1.8/gems/passenger-1.0.3/bin/passenger-spawn-server
RailsRuby /usr/bin/ruby1.8

Create something like this in /etc/apache2/sites-available/ror.myhost.com

<VirtualHost *>
    ServerName ror.myhost.com
    DocumentRoot /home/myuser/www/mynewapp/public
</VirtualHost>

sudo a2enmod rewrite
sudo a2ensite ror.myhost.com
sudo /etc/init.d/apache2 restart

maybe also do..

rails mynewapp