Ruby on Rails on Debian

来自开放百科 - 灰狐
(版本间的差异)
跳转到: 导航, 搜索
第51行: 第51行:
  
 
==Apache==
 
==Apache==
 +
修改 vi /etc/apache2/sites-enabled/000-default
 +
 +
Alias /yourapp/ "/var/www/rails/yourapp/public/"
 +
<Location /yourapp/>
 +
  Options ExecCGI FollowSymLinks
 +
  AddHandler cgi-script .cgi
 +
  AllowOverride all
 +
  Order allow,deny
 +
  Allow from all
 +
</Location>
 +
 +
/etc/init.d/apache2 restart
  
 
==Lighttpd==
 
==Lighttpd==

2006年9月9日 (六) 11:04的版本

目录

安装Ruby,Rails

aptitude install ruby libzlib-ruby rdoc irb

or

apt-get install ruby libzlib-ruby rdoc irb

测试

debian:/var/www/python# irb

irb(main):001:0> 3+5

=> 8

安装rails

http://rubyforge.org/frs/?group_id=307 获得安装包

如:rails-0.14.4.tgz

tar zxvf rails-0.14.4.tgz

cd rails

ruby script/server

http://locahost:3000  :) OK

推荐安装方式

http://ww.ruby-lang.org/en 获得 ruby
tar zxvf ruby-x.y.z.tar.gz
cd ruby-x.y.z
./configure
make 
make test
make install
从http://rubygems.rubyforge.org 获得 rubygems
如 tar zxvf rubygems-0.8.11.tar.gz
cd rubygems-0.8.11 
ruby setup.rb all
gem install rails --include-dependencies

更新 Rails

gem update rails 

创建第一个应用

rails yourapp

Apache

修改 vi /etc/apache2/sites-enabled/000-default

Alias /yourapp/ "/var/www/rails/yourapp/public/" <Location /yourapp/>

  Options ExecCGI FollowSymLinks
  AddHandler cgi-script .cgi
  AllowOverride all
  Order allow,deny
  Allow from all
</Location>
/etc/init.d/apache2 restart

Lighttpd

Database

  • libmysql-ruby
  • libpgsql-ruby
  • libsqlite3-ruby
# apt-get install libpgsql-ruby
# irb
irb(main):001:0> require 'postgres'
=> true
irb(main):002:0> exit

RadRails

http://www.radrails.org/ 获得安装包

参考资料

Ruby on Rails on Debian

http://www.debian-administration.org/articles/329

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱