【发布时间】:2014-02-15 06:31:58
【问题描述】:
(顺便说一句,它告诉我我在这里有代码并且必须对其进行格式化,所以如果有什么看起来很奇怪,因为它不会让我发布它。)
在过去的两天里,我实际上已经重新安装了 3 次 Windows 8,并且实际上使用 Ubuntu 创建了双启动,这个问题令人沮丧。 (决定学习一个全新的操作系统比尝试修复 Windows 问题更烦人)
所以,总的来说,我是编码新手,但我一直在玩 ruby 和 rails 并决定尝试让数据库工作正常,每次遇到相同类型的问题时,这似乎是某种 windows 64 位 MySQL ruby 版本混淆。
我正在使用 Windows 6.1 64 和 ruby 2.0.0p353 (2013-11-22) [x64-mingw32] rails 4.0.2 和 MySQL 5.6
I've installed the devkit and did the test using ruby -rubygems -e "require 'json'; puts JSON.load('[42]').inspect" and it returned 42 and that whole installation seemed to go fine.
rails installed ruby 已安装,所有 -v 显示我列出的版本。
现在当我去安装 MySQL gem 时,它给了我这个。
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
C:/Ruby200-x64/bin/ruby.exe extconf.rb
checking for main() in -llibmysql... no
*** 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.
I read up and tried doing this after installing the MySQL c connector. And it returns as follows.
C:\Users\ryan>gem install mysql2 --platform=ruby -- '--with-mysql-dir="C:/mysql-
connector-c-6.1.3-win32/"'
Temporarily enhancing PATH to include DevKit...
Building native extensions with: '--with-mysql-dir="C:/mysql-connector-c-6.1.3-w
in32/"'
This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
C:/Ruby200-x64/bin/ruby.exe extconf.rb --with-mysql-dir="C:/mysql-connector-
c-6.1.3-win32/"
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
-----
Cannot find include dir at C:/mysql-connector-c-6.1.3-win32//include
-----
*** 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.
I have devoted days to this problem, and reinstalled more things than I care to admit. Does anyone have any ideas how I could possibly fix this... ?
好的,这就是它现在吐出来的东西..
C:\Users\ryan>gem install mysql --platform=ruby --with-mysql-dir=c:\mysql-con 连接器-c-6.1.3-win32 暂时增强 PATH 以包含 DevKit... 使用以下命令构建本机扩展:'--with-mysql-dir=c:\mysql-connector-c-6.1.3-wi n32' 这可能需要一段时间... 错误:安装mysql时出错: 错误:无法构建 gem 原生扩展。
C:/Ruby200-x64/bin/ruby.exe extconf.rb --with-mysql-dir=c:\mysql-connector-c
-6.1.3-win32 检查 -llibmysql 中的 main()... 否 * extconf.rb 失败 * 由于某种原因无法创建 Makefile,可能缺乏必要 库和/或标题。检查 mkmf.log 文件以获取更多详细信息。你可以 需要配置选项。
提供的配置选项: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --没有-make-prog --srcdir=。 --curdir --ruby=C:/Ruby200-x64/bin/ruby --with-mysql-dir --with-mysql-include --without-mysql-include=${mysql-dir}/include --with-mysql-lib --without-mysql-lib=${mysql-dir}/ --with-libmysqllib --without-libmysqllib
Gem 文件将继续安装在 C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql -2.9.1 进行检查。 结果记录到 C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql-2.9.1/ext/mysql_ api/gem_make.out
【问题讨论】:
标签: mysql ruby-on-rails ruby windows 64-bit