ruby on rails + xampp + mysql(Windows 7) [英] ruby on rails + xampp + mysql (windows 7)

查看:104
本文介绍了ruby on rails + xampp + mysql(Windows 7)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将xampp中包含的mysql软件包与ruby一起使用在Windows 7的导轨上,但是似乎无法使它们协同工作.

I am trying to use the mysql package included in xampp with ruby on rails on windows 7, but cannot seem to get them to work together.

我有Rails 3.0.0和xampp 1.7.3

I have rails 3.0.0 and xampp 1.7.3

rails可以在xampp中与sqlite一起使用,但是在尝试通过"rails new project -d mysql; cd project; bundle install"使用mysql时

rails works with sqlite within xampp just fine, but when attempting to use mysql via "rails new project -d mysql; cd project; bundle install"

我得到以下信息:


Installing mysql2 (0.2.4) with native extensions C:/xampp/Ruby192/lib/ruby/1.9.1
/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Fail
ed to build gem native extension. (Gem::Installer::ExtensionBuildError)

C:/xampp/Ruby192/bin/ruby.exe extconf.rb
checking for rb_thread_blocking_region()... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

我错过了什么吗?有关此问题的所有帖子都告诉我使用gem install mysql---with-mysql-config = PATH,但这似乎不适用于Windows,因为无论如何我都会遇到相同的错误.

Am I missing anything? All the posts about this issue tell me to use gem install mysql -- --with-mysql-config=PATH, but this does not seem to work with Windows, as I get the same error regardless.

如果不可能,现在使用sqlite,然后再尝试将数据库迁移到mysql(或另一个更可靠的数据库)上是否有任何弊端?

And if it's just not possible, are there any drawbacks to using sqlite now, then trying to migrate the databse over to mysql (or another more robust database) later?

推荐答案

gem install mysql --no-rdoc --no-ri -- '--with-mysql-lib="D:\xampp\mysql\lib" --with-mysql-include="D:\xampp\mysql\include"'

我将此代码用于mysql解决方案,这是将mysql用于xampp的正确方法.

I used this code for my solution of mysql this is the right way you can USE mysql for xampp.

这篇关于ruby on rails + xampp + mysql(Windows 7)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆