ruby on rails + xampp + mysql (windows 7)(ruby on rails + xampp + mysql (windows 7))
问题描述
我正在尝试在 Windows 7 上将 xampp 中包含的 mysql 包与 ruby on rails 一起使用,但似乎无法让它们一起工作.
我有 rails 3.0.0 和 xampp 1.7.3
rails 可以在 xampp 中使用 sqlite,但是当尝试通过rails new project -d mysql; cd project; bundle install"使用 mysql 时
我得到以下信息:
<上一页>使用本机扩展安装 mysql2 (0.2.4) C:/xampp/Ruby192/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': 错误: 失败ed 来构建 gem 原生扩展.(Gem::Installer::ExtensionBuildError)C:/xampp/Ruby192/bin/ruby.exe extconf.rb检查 rb_thread_blocking_region()... *** extconf.rb 失败 ***由于某种原因无法创建 Makefile,可能缺少必要的库和/或头文件.查看 mkmf.log 文件了解更多信息细节.您可能需要配置选项.我错过了什么吗?所有关于这个问题的帖子都告诉我使用 gem install mysql -- --with-mysql-config=PATH,但这似乎不适用于 Windows,因为无论如何我都会遇到同样的错误.
如果这是不可能的,那么现在使用 sqlite 是否有任何缺点,然后尝试将数据库迁移到 mysql(或另一个更强大的数据库)?
gem install mysql --no-rdoc --no-ri -- '--with-mysql-lib="D:xamppmysqllib" --with-mysql-include="D:xamppmysqlinclude"'我将此代码用于我的 mysql 解决方案,这是您可以将 mysql 用于 xampp 的正确方法.
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.
I have rails 3.0.0 and xampp 1.7.3
rails works with sqlite within xampp just fine, but when attempting to use mysql via "rails new project -d mysql; cd project; bundle install"
I get the following:
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.
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.
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:xamppmysqllib" --with-mysql-include="D:xamppmysqlinclude"'
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)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:ruby on rails + xampp + mysql (windows 7)
基础教程推荐
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- 带更新的 sqlite CTE 2022-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
