mysql2

Installing MySQL2 Gem on Windows

青春壹個敷衍的年華 提交于 2019-11-30 07:36:07
问题 I was having some issues getting the mysql2 gem to install on my Windows 8.1 machine. I followed the instructions in this post: Ruby MYSQL2 gem installation on windows 7 to install the mysql2 gem, and I did not get any error messages. I followed this with the bundle install command, and confirmed that the following gems are installed (using bundle show), confirming that I have the following gems installed: Using devise (3.2.2) Using mysql2 (0.3.14) Then I tried doing: rails generate devise

Rails development - Can't connect to MySQL server on 'localhost' (10061)

眉间皱痕 提交于 2019-11-30 06:48:22
I'm a Rails developer newbie using MySQL as the database. I can successfully connect to MySQL using the command: MySQL -u macDaddy -p at the command prompt, so I know the user is valid and MySQL is running. But when I try to run rake db:schema:dump at the command line I get this error: rake aborted! Can't connect to MySQL server on 'localhost' (10061) Is something wrong with my database.yml? Here it is: development: adapter: mysql2 encoding: utf8 reconnect: false database: bookmobile pool: 5 username: macDaddy password: booklover host: localhost socket: mysql port: 3306 I've also tried

Rails 3.1 / mysql2 error : “MySQL server has gone away”

只愿长相守 提交于 2019-11-30 05:37:11
I'm experiencing trouble upgrading my rails 2.3.14 / ruby 1.8.7 app to 3.1.1/1.9.2 : I have some (ActiveRecord::StatementInvalid) "Mysql2::Error: MySQL server has gone away" errors happening sporadically. It's important to precise that I never had such issues with the 'mysql' gem on 2.3.14 and the exactly same db (so the bug shouldn't come from mysql (v5.5.10)). Example : $ rails c production Loading production environment (Rails 3.1.1) ruby-1.9.2-p290 :001 > ActiveRecord::Base.connection.active? => false ruby-1.9.2-p290 :002 > exit $ rails c production Loading production environment (Rails 3

Please install mysql adapter 'gem install activerecord-mysql-adapter'

别来无恙 提交于 2019-11-30 04:41:34
I'm having trouble finding a solution to this problem. I'm getting the error: Please install the mysql adapter: 'gem install activerecord-mysql-adapter' /Users/ Andy/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/rubygems_integration.rb:143:in `block in replace_gem': Please install the mysql adapter: `gem install activerecord-mysql-adapter` (mysql is not part of the bundle. Add it to Gemfile.) (LoadError) from /Users/ Andy /mysql2/ruby/1.9.1/gems/activerecord-3.2.1/lib/active_record/connection_adapters/mysql_adapter.rb:5:in `<top (required)>' from /Users/ Andy /mysql2/ruby/1

How to use “mysql2” gem in Rails 3 application on Windows 7?

只愿长相守 提交于 2019-11-30 02:29:00
I try to install the mysql2 gem on Windows 7 32-bit. I run: gem install mysql2 and I get the following error: ERROR: Error installing mysql2: The 'mysql2' native gem requires installed build tools. Please update your PATH to include build tools or download the DevKit from 'http://rubyinstaller.org/downloads' and follow the instructions at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit' Any ideas what could cause this error, and how to solve this ? UPDATE I did everything as described here , but I can't figure out the last step: gem install mysql2 -- '--with-mysql-lib="c:

Installing Mysql 2 gem fails

試著忘記壹切 提交于 2019-11-29 13:22:55
I am trying to install mysql2 (version 0.4.5 ) and I am using Rails 5.0.2 , Ruby 2.3.1 I've already installed mysql server using homebrew (version 8.0.11)and started mysql as: brew install mysql brew services start mysql Gemfile.rb gem 'mysql2' When I try installing gem mysql2 I am getting the following error Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /Users/gomathi/.rvm/gems/ruby-2.3.1@connector/gems/mysql2-0.4.5/ext/mysql2 creating Makefile current directory: /Users/gomathi/.rvm/gems/ruby-2.3.1@connector/gems/mysql2-0.4.5/ext/mysql2 make "DESTDIR="

Mysql2 Error MySQL server has gone away

↘锁芯ラ 提交于 2019-11-29 09:30:14
I am getting this error occasionally. I have read some solutions in stackoverflow but they were about rails 2 or mysql. Any help will be appreciated. ActiveRecord::StatementInvalid (Mysql2::Error: MySQL server has gone away There are numerous causes for the error. See below page for possible causes. Perhaps your packet size is set too small. http://dev.mysql.com/doc/refman/5.0/en/gone-away.html Yuval Karmi I got this error while trying to import a large file through seeds.rb with rake db:seed by calling one statement: ActiveRecord::Base.connection.execute(IO.read("path/to/file.sql")) And I

Rails development - Can't connect to MySQL server on 'localhost' (10061)

孤街醉人 提交于 2019-11-29 08:11:52
问题 I'm a Rails developer newbie using MySQL as the database. I can successfully connect to MySQL using the command: MySQL -u macDaddy -p at the command prompt, so I know the user is valid and MySQL is running. But when I try to run rake db:schema:dump at the command line I get this error: rake aborted! Can't connect to MySQL server on 'localhost' (10061) Is something wrong with my database.yml? Here it is: development: adapter: mysql2 encoding: utf8 reconnect: false database: bookmobile pool: 5

Rails 3.1 / mysql2 error : “MySQL server has gone away”

ぐ巨炮叔叔 提交于 2019-11-29 03:38:39
问题 I'm experiencing trouble upgrading my rails 2.3.14 / ruby 1.8.7 app to 3.1.1/1.9.2 : I have some (ActiveRecord::StatementInvalid) "Mysql2::Error: MySQL server has gone away" errors happening sporadically. It's important to precise that I never had such issues with the 'mysql' gem on 2.3.14 and the exactly same db (so the bug shouldn't come from mysql (v5.5.10)). Example : $ rails c production Loading production environment (Rails 3.1.1) ruby-1.9.2-p290 :001 > ActiveRecord::Base.connection

Ruby mysql2 gem compiled for wrong mysql client library version

元气小坏坏 提交于 2019-11-29 01:50:24
After updating MySQL to 5.5 using apt-get, the mysql2 gem stopped working. Here's the error: Incorrect MySQL client library version! This gem was compiled for 5.5.17 but the client library is 5.1.58. (RuntimeError) I tried reinstalling with mysql_config but it doesn't seem to make a difference.. gem install mysql2 -- --with-mysql-config=/usr/bin/mysql_config Correspondingly, I tried telling bundle to compile mysql2 with mysql-config but still, the error remains.. bundle config build.mysql2 --with-mysql-config=/usr/bin/mysql_config bundle install When I tried an older version of the gem (v0.2.6