mysql2

bundle install problem: mysql.h is missing

有些话、适合烂在心里 提交于 2019-11-28 03:41:28
in my mac OSX 10.6 32 bit, I can install mysql2 gem quite easily, but not in mini mac 10.6 64bit server. I have installed MySQL 5.5.11 in troublesome server, while in my home mac MySQL 5.5.0.m2 Somehow when I run bundle install, in server it tries to install mysql2.0.3.2 while in home mysql2.0.2.6 Please don't tell me to env ARCHFLAGS="-arch x86_64" sudo gem install mysql2 --version '= 0.2.6' -- --with-mysql-config=/usr/local/mysql/bin/mysql_config I tried that, doesn't work. Included /usr/local/mysql/bin in $PATH does not help as well. Error code: Installing mysql2 (0.3.2) with native

ERROR: Failed to build gem native extension (mysql2 on rails 3.2.3)

♀尐吖头ヾ 提交于 2019-11-28 03:33:39
I'm trying to install the mysql2 gem with Rails 3.2.3 and it's failing: ★ bundle install Fetching gem metadata from https://rubygems.org/......... Using rake (0.9.2.2) Using i18n (0.6.0) Using multi_json (1.2.0) Using activesupport (3.2.3) Using builder (3.0.0) Using activemodel (3.2.3) Using erubis (2.7.0) Using journey (1.0.3) Using rack (1.4.1) Using rack-cache (1.2) Using rack-test (0.6.1) Using hike (1.2.1) Using tilt (1.3.3) Using sprockets (2.1.2) Using actionpack (3.2.3) Using mime-types (1.18) Using polyglot (0.3.3) Using treetop (1.4.10) Using mail (2.4.4) Using actionmailer (3.2.3)

Mysql2 Error MySQL server has gone away

无人久伴 提交于 2019-11-28 02:52:31
问题 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 回答1: 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 回答2: I got this error while trying to import a large file through seeds.rb with rake db:seed

Error when trying to install app with mysql2 gem

筅森魡賤 提交于 2019-11-27 17:57:10
Im trying to install an open source rails 3.2.21 application that uses the mysql2 gem, but when i try and run the bundle commant I get the following error: Fetching: mysql2-0.3.18.gem (100%) Building native extensions. This could take a while... p ERROR: Error installing mysql2: ERROR: Failed to build gem native extension. /Users/my_username/.rvm/rubies/ruby-2.1.2/bin/ruby -r ./siteconf20150614-72129-orqsb7.rb extconf.rb checking for ruby/thread.h... yes checking for rb_thread_call_without_gvl() in ruby/thread.h... yes checking for rb_thread_blocking_region()... yes checking for rb_wait_for

Rails 4 - Gem::LoadError: Specified 'mysql2' for database adapter, but the gem is not loaded

混江龙づ霸主 提交于 2019-11-27 17:05:29
In my gemfile I have: gem 'mysql2' My database.yml is as follows: default: &default adapter: mysql2 database: <%= ENV['db_name'] %> username: <%= ENV['db_user'] %> password: <%= ENV['db_pass'] %> host: <%= ENV['db_host'] %> pool: 32 socket: <%= ENV['socket'] %> development: <<: *default production: <<: *default I've run both bundle update and bundle install and my Gemfile.lock shows mysql2. However when I run rake db:migrate I get this on both my computer and on the staging server: myproject.com(master)$ rake db:migrate WARNING: Use strings for Figaro configuration. 10000012508 was converted

Ruby mysql2 gem compiled for wrong mysql client library version

依然范特西╮ 提交于 2019-11-27 16:12:35
问题 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 -

Cannot install mysql2 gem

走远了吗. 提交于 2019-11-27 11:57:28
I'm unable to install the mysql2 gem in my Windows7 x64 system. I tried using both the 32-bit and 64-bit versions of MySQL server but none got me any further. I installed Ruby 1.8, the development kit and and the Rails platform. I even installed minGW to allow C++/C compilation of things. MySQL Server was installed in the default location. When running the command: C:\Users\Arne>gem install mysql2 -- --with-mysql-include="C:\Program Files (x86)\MySQL\MySQL Server 5.1\include" --with-mysql-lib="C:\Program Files (x86)\MySQL\MySQL Server 5.1\lib\" I receive the following output from the console:

Gem::LoadError for mysql2 gem, but it's already in Gemfile

喜夏-厌秋 提交于 2019-11-27 10:46:09
Gem::LoadError Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile This error occurred while loading the following files: active_record/base This is the error I get on running rails server. The mysql2 gem has been added to the Gemfile as well. I've done bundle install , and tried restarting the server but still get the error. Hassan Azimi If you have this error when upgrading to rails 4.2.4 (also with rails 4.1.5) try using this version of mysql2: gem 'mysql2', '~> 0.3.18' Apparently mysql2 isn't still compatible with newer version of rails

Creating tables and problems with primary key in Rails

梦想与她 提交于 2019-11-27 10:07:21
问题 When I try to run the following code in Rails using Mysql2 as database manager: rake db:migrate I obtain the following error: rake aborted! "Mysql2::Error: All parts of a PRIMARY KEY must be NOT NULL:" Why do I get this error, if the primary key in a table by default is NOT "null"? Migration code, however : class CreateUsers < ActiveRecord::Migration def change create_table :users do |t| t.string "first_name" t.timestamps end end end 回答1: I had a same problem before, and I solved according to

Error “…cannot load such file — mysql2/2.0/mysql2 (LoadError)”. On Windows XP with Ruby 2.0.0

☆樱花仙子☆ 提交于 2019-11-27 09:05:53
The command rails server throws this error. C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2:in `require': cannot load such file -- mysql2/2.0/mysql2 (LoadError) I use Ruby 2.0.0 from RubyInstaller on Windows XP box. I figured out what is the problem but I don't know how to solve it. The problem is that there is no any 2.0/ directory in the mysql2-0.3.11-x86-mingw32 gem. This is the gem that rails installs as its dependency from Gemfile : GEM remote: https://rubygems.org/ specs: ... many gems here mysql2 (0.3.11-x86-mingw32) ... many gems here DEPENDENCIES .