我收到这个错误
`establish_connection': Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (no such file to load -- active_record/connection_adapters/mysql2_adapter) (RuntimeError)
from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-
Run Code Online (Sandbox Code Playgroud)
这是整个错误和我的配置和gemfile的转储.
当尝试通过我的rails应用程序连接到mysql服务器时,我收到以下错误
D:/Program_Files/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require':
Incorrect MySQL client library version! This gem was compiled for 6.0.0 but the client library is 5.0.27. (RuntimeError)
Run Code Online (Sandbox Code Playgroud)
我怎样才能纠正它?
我试图mysql2通过Bundler 安装gem,但它一直死于以下错误:
** executing command
/home/cc_rails/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems/installer.rb:483:in 'rescue in block in build_extensions':
ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/home/cc_rails/.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb --with-mysql-config=/usr/bin/mysql_config
checking for rb_thread_blocking_region()... yes
checking for mysql.h... no
checking for mysql/mysql.h... no
-----
mysql.h is missing. please check your installation of mysql and try again.
-----
*** 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 …Run Code Online (Sandbox Code Playgroud) 运行bundle install时出错
Installing mysql2 (0.3.11) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
...
Make sure that `gem install mysql2 -v '0.3.11'` succeeds before bundling.
Run Code Online (Sandbox Code Playgroud)
当我运行确保gem install mysql2 -v '0.3.11'.我仍然得到相同的错误.
我收到了这个错误:
sudo gem install mysql2
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
checking for rb_thread_blocking_region()... no
checking for mysql.h... no
checking for mysql/mysql.h... no
-----
mysql.h is missing. please check your installation of mysql and try again.
-----
*** 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 …Run Code Online (Sandbox Code Playgroud) 我正在尝试为Ruby Enterprise Edition安装gem mysql2.我收到的错误是:
Installing mysql2 (0.2.7) with native extensions /Users/rookieRails/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/installer.rb:551:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/Users/vinayashrestha/.rvm/rubies/ree-1.8.7-2011.03/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for …Run Code Online (Sandbox Code Playgroud) 我尝试了几个想法......它们都没有用......我只是想安装mysql2作为宝石.我的mysql正在运行,但每次我的系统说,mysql.h都丢失了......有人有想法吗?现在非常令人沮丧......
我正在使用osx 10.8.3,ruby 1.9.3,rails 3.2.13和home-brew.
gem install mysql2 -v '0.3.11'
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/Users/gadreel/.rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for mysql.h... no
checking for mysql/mysql.h... no
-----
mysql.h is missing. please check your installation of mysql and try again.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. …Run Code Online (Sandbox Code Playgroud) 我在Windows7中安装了Ruby版本ruby 1.9.2p0(2010-08-18)[i386-mingw32].和宝石vesion 1.3.7
当我试图安装mysql gem时,它显示Failed to build gem native extension错误,为什么会这样?我的mysql版本是5.1.36(WampServer)
E:\RubyApps\test_app2>gem install mysql2
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
E:/Ruby192/bin/ruby.exe extconf.rb
checking for rb_thread_blocking_region()... *** 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 …Run Code Online (Sandbox Code Playgroud) 我收到这个错误
Gem文件将保留在
/home/mark/.bundler/tmp/28288/gems/mysql2-0.2.17中进行检查.
结果登录到
/home/mark/.bundler/tmp/28288/gems/mysql2-0.2.17/ext/mysql2/gem_make.out
安装mysql2(0.2.17)时出错,Bundler无法
继续. 在捆绑之前确保gem install mysql2 -v '0.2.17'成功
.
使用Ruby on Rails应用程序,我无法解决它.
我正在尝试在我的Snow Leopord系统Macbook Pro 13上安装do_mysql,但我不断收到此错误:
n216-160:~ myself$ sudo gem1.9 install do_mysql
Password:
Building native extensions. This could take a while...
ERROR: Error installing do_mysql:
ERROR: Failed to build gem native extension.
/opt/local/bin/ruby1.9 extconf.rb
checking for mysql_query() in -lmysqlclient... 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 …Run Code Online (Sandbox Code Playgroud)