私はRubyでもう少しプレイしたいと思っていますが、現在はsinatraを把握しているようですが、リレーショナルデータベースからデータを取得したいと思っています。私はテストアプリケーションのためのMySQLを使用する傾向があり、宝石のインストールを試みたが、それはそれが依存しているネイティブのdo_mysqlの宝石をコンパイルしようとすると例外が発生し続ける。Datamapperのdm_mysql_adapter gemはウィンドウでサポートされていますか?
私はネイティブエクステンションをインストールしていて、JSONの宝石のためにうまくいきました。私はdo_mysqlが現在Windows用にサポートされていなかったことを少し覚えています。
C:\dump\ruby\DataMapperTest\gems>gem install dm-mysql-adapter-1.2.0.gem
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing dm-mysql-adapter-1.2.0.gem:
ERROR: Failed to build gem native extension.
C:/Tools/Ruby192/bin/ruby.exe extconf.rb
checking for my_global.h... no
checking for mysql.h... no
checking for main() in -llibmysql... no
checking for mysql_query() in mysql.h... no
checking for mysql_ssl_set() in mysql.h... no
checking for localtime_r()... no
checking for gmtime_r()... no
checking for mysql.h... no
checking for MYSQL_TYPE_STRING in mysql.h... no
checking for MYSQL_TYPE_BIT in mysql.h... no
checking for MYSQL_TYPE_NEWDECIMAL in mysql.h... no
checking for mysql_query() in mysql.h... no
checking for mysql_ssl_set() in mysql.h... no
checking for mysql_sqlstate() in mysql.h... no
checking for mysql_get_ssl_cipher() in mysql.h... no
checking for mysql_set_character_set() in mysql.h... no
checking for mysql_get_server_version() in mysql.h... no
checking for MYSQL_FIELD.charsetnr in mysql.h... no
creating Makefile
make
C:/Tools/Ruby192/bin/ruby -e "puts 'EXPORTS', 'Init_do_mysql'" > do_mysql-i386-
mingw32.def
gcc -I. -IC:/Tools/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Tools/Ruby192/in
clude/ruby-1.9.1/ruby/backward -I/C/Tools/Ruby192/include/ruby-1.9.1 -I. -O3 -
g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings
-Wno-missing-field-initializers -Wno-long-long -Wall -o do_common.o -c do_com
mon.c
gcc -I. -IC:/Tools/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Tools/Ruby192/in
clude/ruby-1.9.1/ruby/backward -I/C/Tools/Ruby192/include/ruby-1.9.1 -I. -O3 -
g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings
-Wno-missing-field-initializers -Wno-long-long -Wall -o do_mysql.o -c do_mysq
l.c
do_mysql.c:5:19: fatal error: mysql.h: No such file or directory
compilation terminated.
make: *** [do_mysql.o] Error 1
Gem files will remain installed in C:/Tools/Ruby192/lib/ruby/gems/1.9.1/gems/do_
mysql-0.10.7 for inspection.
Results logged to C:/Tools/Ruby192/lib/ruby/gems/1.9.1/gems/do_mysql-0.10.7/ext/
do_mysql/gem_make.out
C:\dump\ruby\DataMapperTest\gems>
のMySQL 5.5コミュニティ版がインストールされ、構成とMySQLされます。Windows 7上のルビー1.9.2を使用して
は、それが助け包みここ
は例外です(ルビーインストーラ+ネイティブ拡張を介してインストール)システムPATHに追加されました。
治療を受けて、新しいことを学びました。助けに時間を割いてくれてありがとう!私がスローしたのは、コマンドラインでMySQLディレクトリを指定していて、相対パスを使用しようとしていて、エラーを引き起こしていて絶対的に修正したときでした(絶対的なものですが、didntそれが必要条件であったことを知ってください)。 – Grofit
恐ろしいですが、それを言及するために指示が更新され、また、パスにはスペースが付きません! :) –