在Windows上在轨道上的红宝石的本机扩展概率宝石时间 [英] on windows Mysql native extension prob in ruby on rails gem time

查看:110
本文介绍了在Windows上在轨道上的红宝石的本机扩展概率宝石时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我是第一次安装应用程序,因为我在我的系统上使用Mysql DB,所以需要pro的帮助,我也安装了它的gem,但是当我在安装Bundle时遇到了这个错误为一个新的项目应用程序。
错误发生在 bundle install处于以下阶段时:

 安装mysql2 0.2.13)与本地扩展

C:\Sites\proj2>捆绑安装
获取 http://rubygems.org/
的源索引使用rake(0.9.2)
使用抽象(1.0.0)
使用activesupport(3.0.9)
使用构建器(2.1.2)
使用i18n(0.5.0)
使用activemodel(3.0 .9)
使用erubis(2.6.6)
使用机架(1.2.3)
使用机架安装(0.6.14)
使用机架测试(0.5.7) )
使用tzinfo(0.3.29)
使用actionpack(3.0.9)
使用mime-types(1.16)
使用多边形(0.3.2)
使用treetop(1.4.10)
使用邮件(2.2.19)
使用actionmailer(3.0.9)
使用arel(2.0.10)
使用activerecord(3.0.9)
使用主动资源(3.0.9)
Us使用本机扩展安装mysql2(0.2.13) C:/RailsInstaller/Ruby1.8.7/li
b / ruby​​ / site_ruby / 1.8 / ruby​​gems /installer.rb:533:in`build_extensions':错误:Fai
导致构建gem原生扩展。 (Gem :: Installer :: ExtensionBuildError)

  C:/RailsInstaller/Ruby1.8.7/bin/ruby.exe extconf.rb 
检查rb_thread_blocking_region()... no
检查main()in -llibmysql ... no
*** 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
--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文件将保持安装在C:/ RailsInstaller / Ruby1.8.7 / lib / ruby​​ / gems / 1.8
/gems/mysql2-0.2.13进行检查。
结果记录到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` 'C:/RailsInstaller/Ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/install
er.rb:486中的每个'
':C:/ RailsInstaller中的`build_extensions'
/Ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/install
er.rb:159:在`install'中
从C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/ 1.8 / gems / bundler-1.0.15 / l
ib / bundler / source.rb:101:在`install'中
从C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8 /gems/bundler-1.0.15/l
ib / bundler / ruby​​gems_integration.rb:78:在`preserve_paths'中从$ C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/获得
gems / bundler-1.0.15 / l
ib / bundler / source.rb:91:在`install'中
从C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems /bundler-1.0.15/l
ib / bundler / installer.rb:58:在`run'中
从C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/外滩ler-1.0.15 / l
ib / bundler / ruby​​gems_integration.rb:93:在`with_build_args'$ C $ / b中的C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler -1.0.15 / l
ib / bundler / installer.rb:57:在`run'中
从C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler- 1.0.15 / l
ib / bundler / spec_set.rb:12:在'each'中
来自C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0 .15 / l
ib / bundler / spec_set.rb:12:在C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0的`each'
中。 15 / l
ib / bundler / installer.rb:49:在`run'中
从C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15 / l
ib / bundler / installer.rb:8:在`install'中
从C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/ l
ib / bundler / cli.rb:222:在`install'中
从C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/l
ib / bundler / vendor / thor / task.rb:22:在`send'
从C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/l
ib / bundler / vendor / thor / task.rb:22:在`run'中$来自C的b $ b:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/l
ib / bundler / vendor / thor / invocation.rb:118:在` invoke_task'C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/l
ib / bundler / vendor / thor.rb:246:in从C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/l
ib / bundler / vendor / thor / base.rb'dispatch'
: 389:在`开始'中
来自C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.15/b
/ bundle:13
从C:/RailsInstaller/Ruby1.8.7/bin/bundle:19:在`load'
从C:/RailsInstaller/Ruby1.8.7/bin/bundle:19

C:\\ \\Sites\proj2>


解决方案

因此,需要进行编译。



由于您使用的是RailsInstaller,您已经拥有几乎所有的组件来解决这个问题,但我建议您阅读博客我在Windows上发布了编译mysql / mysql2 gem的文章: mysql-on-windows-7-x64-and-using-ruby-with-it /rel =nofollow> http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows -7-x64-and-using-ruby-it-it /

然后,您可以 bundle install ,并且由于该宝石已经安装,所以应该在之后工作。


As I'm new to ruby on rails,need help of pro's,in first app installation,as I'm using Mysql DB on my system,i installed its gem also,but Im getting this error when I doing Bundle install for a new project app. This below error happens when bundle install is on stage of:

Installing mysql2 (0.2.13) with native extensions  

C:\Sites\proj2>bundle install Fetching source index for http://rubygems.org/ Using rake (0.9.2) Using abstract (1.0.0) Using activesupport (3.0.9) Using builder (2.1.2) Using i18n (0.5.0) Using activemodel (3.0.9) Using erubis (2.6.6) Using rack (1.2.3) Using rack-mount (0.6.14) Using rack-test (0.5.7) Using tzinfo (0.3.29) Using actionpack (3.0.9) Using mime-types (1.16) Using polyglot (0.3.2) Using treetop (1.4.10) Using mail (2.2.19) Using actionmailer (3.0.9) Using arel (2.0.10) Using activerecord (3.0.9) Using activeresource (3.0.9) Using bundler (1.0.15) Installing mysql2 (0.2.13) with native extensions C:/RailsInstaller/Ruby1.8.7/li b/ruby/site_ruby/1.8/rubygems/installer.rb:533:in `build_extensions': ERROR: Fai led to build gem native extension. (Gem::Installer::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 was released without binaries for Windows. Because of that, compilation is required.

Since you're using RailsInstaller, you already have pretty much all the components to solve this, but I will recommend you read a blog article I posted about compiling mysql/mysql2 gem on Windows:

http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/

Then, you can bundle install and since the gem was already installed, it should be working afterwards.

这篇关于在Windows上在轨道上的红宝石的本机扩展概率宝石时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆