Mac 下基于ruby 1.9安装Rails
by Elton on 五.24, 2009, under Mac
ruby 1.9.1出来了,今天用它安装了rails。 一次成功, 将过程记录下来,备忘。
*************************************
源码安装Ruby
*************************************
tar xvzf ruby-1.9.1-p0.tar.gz
cd ruby-1.9.1
./configure –enable-shared –enable-pthread CFLAGS=-D_XOPEN_SOURCE=1
make
sudo make install
*************************************
安装Ruby
*************************************
sudo gem install rails
升级gem
sudo gem update –system
*************************************
安装Ruby for sqlite3
*************************************
sudo gem install sqlite3-ruby
*************************************
源码安装MySQL
*************************************
tar xvzf mysql-5.1.34.tar.gz
cd mysql-5.1.34.tar.gz
CC=gcc CFLAGS=”-O3 -fno-omit-frame-pointer” CXX=gcc
CXXFLAGS=”-O3 -fno-omit-frame-pointer -felide-constructors
-fno-exceptions -fno-rtti”
./configure –prefix=/usr/local/mysql
–with-extra-charsets=complex –enable-thread-safe-client
–enable-local-infile –disable-shared –with-plugins=innobase
make
sudo make install
cd /usr/local/mysql
sudo ./bin/mysql_install_db –user=mysql
sudo chown -R mysql ./var/
sudo chgrp -R mysql .
cd /Library/LaunchDaemons
sudo vim com.mysql.mysqld.plist
输入
<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”>
<plist version=”1.0″>
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.mysql.mysqld</string>
<key>Program</key>
<string>/usr/local/mysql/bin/mysqld_safe</string>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>mysql</string>
<key>WorkingDirectory</key>
<string>/usr/local/mysql</string>
</dict>
</plist>
sudo chown root /Library/LaunchDaemons/com.mysql.mysqld.plist
启动MySQL
sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysqld.plist
手工停止MySQL
sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysqld.plist
*************************************
设置路径
*************************************
mate ~/.bash_login
或者
mate ~/.profile
添加:
export PATH=”/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH”
为了使其生效, 执行
. ~/.bash_login 或者 . ~/.profile
*************************************
源码安装MySQL C Binding for Ruby
*************************************
tar xvzf mysql-ruby-2.8.1
cd mysql-ruby-2.8.1
ruby extconf.rb –with-mysql-config=/usr/local/mysql/bin/mysql_config -with-mysql-dir=/usr/local/mysql
make
sudo make install



六月 16th, 2009 on 20:32
You know so many interesting infomation. You might be very wise. I like such people. Don’t top writing.
七月 7th, 2009 on 04:23
Your site is worth beeing in the top cause it contains really amazing information.
七月 7th, 2009 on 06:29
You know so many interesting infomation. You might be very wise. I like such people. Don’t top writing.
七月 6th, 2010 on 10:31
I agree with you. This type of projects should be encouraged and I think that these type of projects are the projects for the future
七月 9th, 2010 on 00:04
Thank you for writing this telling subject material, I ‘m so thrilled about examining your updates tomorrow!
八月 2nd, 2010 on 09:51
I’m impressed! Really informative blog post here my friend. I just wanted to comment & say keep up the quality work. I’ve bookmarked your blog just now and I’ll be back to read more in the future my friend! Also nice colors on the layout, it’s really easy on the eyes.
八月 19th, 2010 on 13:27
Thanks a lot for this, I am greatful for the info
九月 7th, 2010 on 01:33
I just happen to land to this blog and it is a well written article, a little bit on the long end, but a fairly sufficient one.
I very much love the layout too, it is fairly simple to navigate.
十月 15th, 2010 on 08:31
Thanks for this post.
七月 7th, 2009 on 09:08
Thanks
七月 7th, 2009 on 09:09
Thank you for your encouragement!