【问题标题】:Ruby on Rails in Windows 7Windows 7 中的 Ruby on Rails
【发布时间】:2014-03-25 09:20:17
【问题描述】:

我正在按照这些视频安装 ruby​​ -

https://www.youtube.com/watch?v=y0X7SUfF928&list=PLcwklDOKWhc-k8VsT-ixbAY0TdQI5JLoW

以前我收到这些错误

此 gem 为 6.0.0 编译的 mysql 客户端库版本不正确

然后我点击了这个链接 mysql2 gem compiled for wrong mysql client library

但现在我得到了这些 -

c:/row/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require
': cannot load such file -- mysql2/mysql2 (LoadError)
        from c:/row/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:5
5:in `require'
        from c:/row/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.15/lib/mysql2.rb
:8:in `<top (required)>'
        from c:/row/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:1
35:in `require'
        from c:/row/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:1
35:in `rescue in require'
        from c:/row/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:1
44:in `require'
        from test.rb:1:in `<main>'

请帮帮我...

【问题讨论】:

    标签: mysql ruby-on-rails ruby


    【解决方案1】:

    您可能安装了错误版本的MYSQL C-Connector library

    您需要this one

    基本上,Windows 7 不附带帮助 gem 运行所需的任何 MYSQL 头文件。您需要安装 MYSQL C-Connector 的 32 位版本,然后使用以下命令安装 gem:

    gem install mysql2 —platform=ruby — ‘—with-mysql-dir=”C:\mysql-connector-path”’
    

    【讨论】:

    • 实际上我使用的是 MySQL Server 5.1 ...所以哪个连接器对我来说更好... 6.1 或 6.0 我已经尝试使用 6.0
    • 您应该尝试安装 MYSQL C-Connector 并查看是否可行 :)
    • 知道了!!只是我已经交换了“row.bat”的行..thanx
    【解决方案2】:

    在那个视频中,他们提到了一个文件 row.bat

    我刚刚改变了行的顺序..

    set PATH=c:\windows\system32;c:\windows
    set PATH=%PATH%;C:\row\mysql-connector-c-noinstall-6.0.2-win32\lib
    set PATH=%PATH%;c:\row\Ruby200\bin
    set PATH=%PATH%;C:\Program Files (x86)\MySQL\MySQL Server 5.1\bin
    start "Rails on windows" /D c:\row
    

    它现在可以工作了

    【讨论】:

      猜你喜欢
      • 2011-04-21
      • 1970-01-01
      • 2011-09-22
      • 2011-05-30
      • 1970-01-01
      • 2019-08-31
      • 1970-01-01
      • 2010-12-06
      • 2013-12-30
      相关资源
      最近更新 更多