cgywin下安装mysql和RubyOnRails小记

XP下面运行linux的RubyOnRails

下面是一个简单的过程记录
1. 安装Cygwin
我用的这个
cygwin-release-20061108.iso
有1.29G,好处是不用网络安装,从迅雷下的
运行Cygwin的安装程序。从文见包的的列表中,在DEV里面,确定要选择。就是把skip改了
[quote]• Ruby
• gcc
• subversion
[/quote] 我是这里是安装了所有的DEV环境
你需要使用gcc来建立Cygwin版本的MySQL.

说明一下,这里如果你已经装完了cygwin,用的时候,才发现少装组件。比如vim,那么,不用卸载,直接再点击之前的安装文件,选上组件就行。

2. 在windows上面安装MYSQL:

[quote] download MySQL 5.0 Windows Installer[/quote]

3. 安装MySQL generic source package并且建立它
源码包,编译安装
./configure
make install


4. 安装Ruby Gems
按照正常方式安装,下载Download Gems 释放并安装。

这里ruby我也源码安装,Rubygems 用的

ruby setup.rb


5. 安装Rails:
现在你已经有Gems,你可以安装Rails. 执行:
gem insall rails –include-dependencies

6. 安装mysql gem
运行gem安装mysql。 当出现选择时候,不要安装mswin32,
要安装最新的Unix 版本。

扩展的安装指令(这里没有全部翻译都是安装Cygwin的指令)
但是有一句话要重点说:Windows isn’t the greatest environment for development.
Windows并不是很好的开发环境。

一些注意事项
Ruby: No such file to load -- ubygems (LoadError).

可能是ruby路径问题[quote]libraries in c:ruby/lib/ruby/, Cygwin Ruby expects to find them in /usr/lib/ruby. So Cygwin wasn’t seeing rubygems, or any of the previously installed Gems.[/quote]

如果你的提示错误是:
No such file or directory - /tmp/mysql.sock


那么,请用127.0.0.1代替localhost
参考
[quote]It turns out that connecting to localhost in the Cygwin environment attempts to use UNIX sockets. I run MySQL 4.1 as a Windows service, using NT pipes for local connections. Similar concept, but not interoperable. The quick fix is changing localhost to 127.0.0.1. With an IP address (or any name other than localhost), the client library uses TCP/IP instead.

If you don’t want to build the MySQL client libraries, you can use the pure-Ruby MySQL driver that comes with Rails. That one works out of the box, it’s just faster. It also defaults to using UNIX sockets when connecting to localhost, again just a matter of using 127.0.0.1 instead.
[/quote]
[img]http://www.iteye.com/upload/attachment/96498/59b03cf6-cd62-329a-8070-765309e1ca75.png[/img]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值