由于我是新手Ruby on Rails的,需要帮助的亲,在第一次的应用程序安装,因为我在我的系统上使用MySQL数据库,我也安装了它的gem,但我得到这个错误,当我做一个新的捆绑安装项目应用程序 当 bundle安装在以下阶段时, 会发生以下错误 :
Installing mysql2 (0.2.13) with native extensions
C:\ Sites \ proj2> bundle install获取http://rubygems.org/的源代码索引使用rake(0.9.2)使用abstract(1.0.0)使用activesupport(3.0.9)使用构build器(2.1.2)使用i18n(0.5.0)使用activemodel(3.0.9)使用erubis(2.6.6)使用机架(1.2.3)使用机架安装(0.6.14)使用机架testing(0.5.7)使用tzinfo(0.3。 29)使用actionpack(3.0.9)使用mime-types(1.16)使用polyglot(0.3.2)使用树梢(1.4.10)使用邮件(2.2.19)使用actionmailer(3.0.9)使用arel(2.0.10) )使用activerecord(3.0.9)使用activeresource(3.0.9)使用bundler(1.0.15 )使用本机扩展安装mysql2(0.2.13) C:/RailsInstaller/Ruby1.8.7/li b / ruby / site_ruby / 1.8 / rubygems / installer.rb:533:在`build_extensions'中:错误:Fai导致构buildgem原生扩展。 (gem::安装:: ExtensionBuildError)
C:/RailsInstaller/Ruby1.8.7/bin/ruby.exe extconf.rb checking for rb_thread_blocking_region()... no 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:/RailsInstaller/Ruby1.8.7/bin/ruby --with-mysql-dir --without-mysql-dir --with-mysql-include --without-mysql-include=${mysql-dir}/include --with-mysql-lib --without-mysql-lib=${mysql-dir}/lib --with-libmysqllib --without-libmysqllib Gem files will remain installed in C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8 /gems/mysql2-0.2.13 for inspection. Results logged to C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/mysql2-0.2. 13/ext/mysql2/gem_make.out from C:/RailsInstaller/Ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/install er.rb:486:in `each' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/install er.rb:486:in `build_extensions' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/install er.rb:159:in `install' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/l ib/bundler/source.rb:101:in `install' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/l ib/bundler/rubygems_integration.rb:78:in `preserve_paths' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/l ib/bundler/source.rb:91:in `install' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/l ib/bundler/installer.rb:58:in `run' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/l ib/bundler/rubygems_integration.rb:93:in `with_build_args' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/l ib/bundler/installer.rb:57:in `run' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/l ib/bundler/spec_set.rb:12:in `each' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/l ib/bundler/spec_set.rb:12:in `each' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/l ib/bundler/installer.rb:49:in `run' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/l ib/bundler/installer.rb:8:in `install' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/l ib/bundler/cli.rb:222:in `install' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/l ib/bundler/vendor/thor/task.rb:22:in `send' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/l ib/bundler/vendor/thor/task.rb:22:in `run' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/l ib/bundler/vendor/thor/invocation.rb:118:in `invoke_task' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/l ib/bundler/vendor/thor.rb:246:in `dispatch' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/l ib/bundler/vendor/thor/base.rb:389:in `start' from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/b in/bundle:13 from C:/RailsInstaller/Ruby1.8.7/bin/bundle:19:in `load' from C:/RailsInstaller/Ruby1.8.7/bin/bundle:19 C:\Sites\proj2>
mysql2 0.2.13发布时没有Windows的二进制文件。 因此,编译是必需的。
既然你使用的是RailsInstaller,你已经有了几乎所有的组件来解决这个问题,但是我建议你阅读一篇关于在Windows上编译mysql / mysql2 gem的博客文章:
http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/
然后,你可以bundle install
,因为已经安装了宝石,应该在之后工作。