本站首页    管理页面    写新日志    退出


«September 2025»
123456
78910111213
14151617181920
21222324252627
282930


公告
 本博客在此声明所有文章均为转摘,只做资料收集使用。

我的分类(专题)

日志更新

最新评论

留言板

链接

Blog信息
blog名称:
日志总数:1304
评论数量:2242
留言数量:5
访问次数:7619301
建立时间:2006年5月29日




[Ruby on Rails]Installing Ruby on Rails on Tiger
软件技术

lhwork 发表于 2007/2/7 8:59:11

This article is now out of date, and has been supplanted by a newer version, located here. Many readers have written-in requesting instructions for manual installation of Ruby, Ruby on Rails, FastCGI, and Apache on Mac OS X 10.4 (Tiger). Rather than making readers wait for the release of these instructions until a time when you can fully flesh them out with commentary, you have decided to release them immediately, sans-annotation and with apologies for the lack thereof. Starting Out It’s best to compile in a src file of some kind. It doesn’t really matter where this folder is, it could be one’s Desktop, or /usr/local/src for example. All operations should take place there. You’d start like this:mkdir ~/Desktop/src cd ~/Desktop/src You’ll download to and compile everything from right there. System Prerequisites You might want to have Xcode 2.1 or newer installed. It contains a few updates to the stock Tiger Xcode (2.0) that can make for better executables, like a newer version of Apple’s cctools. Paths Once again, be sure that your path precedence is for /usr/local/bin before /usr/bin or else things won’t work correctly. This can be accomplished with the following lines in a file called .bash_login in your home directory:PATH="/usr/local/bin:/usr/local/sbin:$PATH" export PATH Be sure to close Terminal and open a new one prior to running the commands below. Warning Do this stuff at your own risk. The Narrator won’t take any responsibility if you break your system, cross the streams, or initiate the apocalypse. Ruby Stuff First we install Readline, a prerequisite for Ruby.curl -O ftp://ftp.gnu.org/gnu/readline/readline-5.0.tar.gz tar xzvf readline-5.0.tar.gz cd readline-5.0 ./configure --prefix=/usr/local sed -e 's/-dynamic/-dynamiclib/' shlib/Makefile > shlib/Makefile.new mv shlib/Makefile.new shlib/Makefile make sudo make install cd .. Next up, Ruby.curl -O ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.2.tar.gz tar xzvf ruby-1.8.2.tar.gz cd ruby-1.8.2 ./configure --prefix=/usr/local --with-readline-dir=/usr/local make sudo make install cd .. RubyGems is next.curl -O http://rubyforge.org/frs/download.php/3700/rubygems-0.8.10.tgz tar xzvf rubygems-0.8.10.tgz cd rubygems-0.8.10 sudo ruby setup.rb cd .. With Gems installed, we can get Rails.sudo gem install rails --include-dependencies FastCGI is next.curl -O http://www.fastcgi.com/dist/fcgi-2.4.0.tar.gz tar xzvf fcgi-2.4.0.tar.gz cd fcgi-2.4.0 ./configure --prefix=/usr/local make sudo make install cd .. Next up, Ruby-FastCGI bindingscurl -O http://sugi.nemui.org/pub/ruby/fcgi/ruby-fcgi-0.8.6.tar.gz tar xzvf ruby-fcgi-0.8.6.tar.gz cd ruby-fcgi-0.8.6 /usr/local/bin/ruby install.rb config --prefix=/usr/local ruby install.rb setup sudo ruby install.rb install Next, the Ruby-FCGI Gem.sudo gem install fcgi Apache Stuff Mod-FastCGI is first.curl -O http://www.fastcgi.com/dist/mod_fastcgi-2.4.2.tar.gz tar xzvf mod_fastcgi-2.4.2.tar.gz cd mod_fastcgi-2.4.2 apxs -o mod_fastcgi.so -c *.c sudo apxs -i -a -n fastcgi mod_fastcgi.so cd .. Add this to /etc/httpd/httpd.conf at the end of the file. BBEdit works well for this, and handles authentication for you (bbedit /etc/httpd/httpd.conf from the command line). Feel free to change the port (from 3000) to a port of your choice.<IfModule mod_fastcgi.c> FastCgiIpcDir /tmp/fcgi_ipc/ AddHandler fastcgi-script .fcgi </IfModule> Listen 80 Listen 3000 <VirtualHost *:3000> DocumentRoot /path/to/my/rails/app/public/ <Directory /path/to/my/rails/app/public/> Options ExecCGI FollowSymLinks AddHandler cgi-script .cgi AllowOverride all Allow from all Order allow,deny </Directory> </VirtualHost> Restart apache (using sudo apachectl restart) to get the changes. Done.


阅读全文(1861) | 回复(0) | 编辑 | 精华
 



发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.063 second(s), page refreshed 144794528 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号