本文介绍了如何使用“mysql2"Windows 7 上 Rails 3 应用程序中的 gem?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在 Windows 7 32 位上安装 mysql2 gem.

I try to install the mysql2 gem on Windows 7 32-bit.

我跑:

gem install mysql2

我收到以下错误:

ERROR:  Error installing mysql2:
        The 'mysql2' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

任何想法可能导致此错误,以及如何解决此问题?

Any ideas what could cause this error, and how to solve this ?

更新

我按照这里的描述做了所有事情,但我无法弄清楚最后一步:

I did everything as described here, but I can't figure out the last step:

gem install mysql2 --
     '--with-mysql-lib="c:\Program Files\MySQL\MySQL Server 5.1\lib\opt"
      --with-mysql-include="c:\Program Files\MySQL\MySQL Server 5.1\include"'

我知道我应该将路径更改为系统中的正确路径,但是我在 WAMP 中找不到 lib\optinclude 目录MySQL安装.我使用 WAMP 2.1.

I understand that I should change the paths to the correct paths in my system, but I can't find the lib\opt and the include directories in my WAMP MySQL installation. I use WAMP 2.1.

请指教.

推荐答案

从apachefriends.org试试XAMPP,一定要下载完整版,你会发现lib"、bin"、include"等MySQL目录.更多详情,请参考 -

Try XAMPP from apachefriends.org, be sure to download the full version and you will find "lib", "bin", "include" and other MySQL directories. For further details, refer to -

http://rorguide.blogspot.com/2011/03/installing-mysql2-gem-on-ruby-192-and.html

这篇关于如何使用“mysql2"Windows 7 上 Rails 3 应用程序中的 gem?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 00:51