Tag: rubygems
在snow leopard上编译Ruby, RubyGems, 和Rails
by Elton on 十.01, 2009, under Mac, Rails
准备:
- Snow Leopard系统
- XCode编译环境,Snow Leopard系统盘上有
第一步:设置路径
1 | vim ~/.profile |
在文件最后加上:
1 | export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH" |
使新的路径生效
1 | source ~/.profile |
第二步:下载源文件
1 2 | curl -O ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p174.tar.gz curl -O http://files.rubyforge.vm.bytemark.co.uk/rubygems/rubygems-1.3.5.tgz |
第三步:编译安装
安装ruby
1 2 3 4 5 6 | tar xzvf ruby-1.8.7-p174.tar.gz cd ruby-1.8.7-p174 ./configure --enable-shared --enable-pthread CFLAGS=-D_XOPEN_SOURCE=1 make sudo make install cd .. |
安装rubygem
1 2 3 4 | tar xzvf rubygems-1.3.5.tgz cd rubygems-1.3.5 sudo /usr/local/bin/ruby setup.rb cd .. |
安装rails
1 | sudo gem install rails |
安装ruby的mysql驱动
1 | sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql |
MySQL使用官方的dmg安装即可。


