XAMPP導入メモ

C:\Ruby200-x64\lib\ruby\gems\2.0.0\gems\mysql2-0.3.11\ext\mysql2\gem_make.out
中身

#ref error :ご指定のファイルが見つかりません。ファイル名を確認して、再度指定してください。 (130521XAMPPScreenshot.png)

C:/Ruby200-x64/bin/ruby.exe extconf.rb --with-mysql-dir=C:/PROGRA~1/MYSQL/MYSQLS~1.6 --with-mysql-include=C:/PROGRA~1/MYSQL/MYSQLS~1.6/INCLUDE/
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
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.

Provided configuration options:
--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
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby200-x64/bin/ruby
--with-mysql-dir
--with-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/
--with-libmysqllib
--without-libmysqllib


libを入れてみる

コマンド

c:\devkit>gem install mysql2 -- '--with-mysql-dir=\"C:/Program Files/MySQL/MySQL
Server 5.6\" --with-mysql-include=\"C:/Program Files/MySQL/MySQL Server 5.6/inc
lude/\" --with-mysql-lib=\"C:/Program Files/MySQL/MySQL Server 5.6/lib\"'


結果

Temporarily enhancing PATH to include DevKit...
Building native extensions with: '--with-mysql-dir=\"C:/Program Files/MySQL/MySQ
L Server 5.6\" --with-mysql-include=\"C:/Program Files/MySQL/MySQL Server 5.6/in
clude/\" --with-mysql-lib=\"C:/Program Files/MySQL/MySQL Server 5.6/lib\"'
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:/Program Files/M
ySQL/MySQL Server 5.6\" --with-mysql-include=\"C:/Program Files/MySQL/MySQL Serv
er 5.6/include/\" --with-mysql-lib=\"C:/Program Files/MySQL/MySQL Server 5.6/lib
\"
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
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.

Provided configuration options:
       --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
       --without-make-prog
       --srcdir=.
       --curdir
       --ruby=C:/Ruby200-x64/bin/ruby
       --with-mysql-dir
       --with-mysql-include=${mysql-dir}/include
       --with-mysql-lib=${mysql-dir}/
       --with-libmysqllib
       --without-libmysqllib


Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql
2-0.3.11 for inspection.
Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11/ext/mysq
l2/gem_make.out


コマンド

c:\devkit>gem install mysql2 -- --with-mysql-dir=\"C:/Program Files/MySQL/MySQL
Server 5.6\" --with-mysql-include=\"C:/Program Files/MySQL/MySQL Server 5.6/incl
ude\" --with-mysql-lib=\"C:/Program Files/MySQL/MySQL Server 5.6/lib\"


結果

Temporarily enhancing PATH to include DevKit...
Building native extensions with: '--with-mysql-dir="C:/Program Files/MySQL/MySQL
Server 5.6" --with-mysql-include="C:/Program Files/MySQL/MySQL Server 5.6/inclu
de" --with-mysql-lib="C:/Program Files/MySQL/MySQL Server 5.6/lib"'
This could take a while...
Successfully installed mysql2-0.3.11
Parsing documentation for mysql2-0.3.11
unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/mysql2/mysql2.so, skip
ping
Installing ri documentation for mysql2-0.3.11
1 gem installed
またハマる
c:\devkit\hoge>rails g scaffold item title:string body:text
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11/lib/mysql2.rb:9:in `requir
e': 193: %1 は有効な Win32 アプリケーションではありません。 - C:/Ruby200-x64/l
ib/ruby/gems/2.0.0/gems/mysql2-0.3.11/lib/mysql2/mysql2.so (LoadError)
       from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11/lib/mysql2.rb
:9:in `<top (required)>'
       from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/r
untime.rb:72:in `require'
       from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/r
untime.rb:72:in `block (2 levels) in require'
       from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/r
untime.rb:70:in `each'
       from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/r
untime.rb:70:in `block in require'
       from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/r
untime.rb:59:in `each'
       from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/r
untime.rb:59:in `require'
       from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.r
b:132:in `require'
       from c:/devkit/hoge/config/application.rb:7:in `<top (required)>'
       from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/c
ommands.rb:24:in `require'
       from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/c
ommands.rb:24:in `<top (required)>'
       from script/rails:6:in `require'
       from script/rails:6:in `<main>'

どうやら、InstantRails に含まれる libmySQL.dll を使えばいいらしい。
最終更新:2013年07月17日 10:34