windows ruby1.9.2 rails 3.1.0rc5 折腾之路
由于各种原因,只能在业余时间学习ruby和rails
再由于各种原因,这次必须在windows平台上折腾rails
拜G大神所赐,问题很快就搞定了...
环境:
db:
D:\2chome>mysql -V
mysql Ver 14.12 Distrib 5.0.27, for Win32 (ia32)
app:
ruby :
D:\2chome>ruby -v
ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
主要gem:
rails: Rails 3.1.0.rc5
mysql2 (0.3.6)
步骤
安装 ruby 1.9.2
http://rbudiharso.wordpress.com/2011/03/25/railsinstaller-with-ruby-1-9-2/
安装mysql2
http://www.kyybaventures.com/blog/installing-mysql2-gem-ruby-rails-windows
安装mysql2有些麻烦,列出关键步骤
- copy D:\MySQL\MySQL Connector C 6.0.2\lib\opt to C:\Ruby192\bin (If you have installed ruby in different location change the directory accordingly) (不然后面会报D:/RailsInstaller/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.3.6/lib/mysql2.rb:9:in `require': Incorrect MySQL client library version! This gem was compiled for 6.0.0 but the client library is 5.0.27. (RuntimeError) )
- gem install mysql2 -- '--with-mysql-lib="D:\MySQL\MySQL Connector C 6.0.2\lib\opt" --with-mysql-include="D:\MySQL\MySQL Connector C 6.0.2\include"'
摘要如下:
"No, there is no way that I know of to currently install this gem on windows. The problem is that there is currently no pre-compiled version of the libv8 gem for Windows, and the source version is only compatible with *nix. It does not necessarily have to be that way, it just requires somebody taking the time to make the compile work for Windows. https://github.com/fractaloop/libv8
That said, Windows should come with a JScript, the Microsoft JavaScript runtime, which rails (via execjs) will automatically detect and use, so you should be able to just remove your dependency on therubyracer.
As the maintainer of that gem, this would of course make me sad, but it should get you on your way."
吐槽1:什么时候,能解决些G大神也解决不了的问题呢... 遐想中 :)
吐槽2:今天7夕,由于各种原因,陪不了GF了,GF也陪不了我.... T.T 不过想想还有ruby陪着我....