下面是一个简单的过程记录
1. 安装Cygwin
我用的这个
cygwin-release-20061108.iso
有1.29G,好处是不用网络安装,从迅雷下的
运行Cygwin的安装程序。从文见包的的列表中,在DEV里面,确定要选择。就是把skip改了
引用
• Ruby
• gcc
• subversion
我是这里是安装了所有的DEV环境
• gcc
• subversion
你需要使用gcc来建立Cygwin版本的MySQL.
说明一下,这里如果你已经装完了cygwin,用的时候,才发现少装组件。比如vim,那么,不用卸载,直接再点击之前的安装文件,选上组件就行。
2. 在windows上面安装MYSQL:
引用
download MySQL 5.0 Windows Installer
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路径问题
引用
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.
如果你的提示错误是:
No such file or directory - /tmp/mysql.sock
那么,请用127.0.0.1代替localhost
参考
引用
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.
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.