Hi, I installed the "kwatch-mysql-ruby" gem on my Debian server but when I try to run the "db:migrate" task I get the following error: ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate rake aborted! uninitialized constant MysqlCompat::MysqlRes /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:440:in `rescue in load_missing_constant'' /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:436:in `load_missing_constant'' /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:80:in `const_missing_with_dependencies'' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/mysql_adapter.rb:9:in `define_all_hashes_method!'' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/mysql_adapter.rb:71:in `mysql_connection'' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection'' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `block (2 levels) in checkout'' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `loop'' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `block in checkout'' /usr/local/lib/ruby/1.9.1/monitor.rb:190:in `mon_synchronize'' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout'' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection'' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection'' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection'' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/migration.rb:435:in `initialize'' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/migration.rb:400:in `new'' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/migration.rb:400:in `up'' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/migration.rb:383:in `migrate'' /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.3/lib/tasks/databases.rake:116:in `block (2 levels) in <top (required)>'' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `call'' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `each'' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `execute'' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'' /usr/local/lib/ruby/1.9.1/monitor.rb:190:in `mon_synchronize'' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level'' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `each'' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level'' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run'' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:1998:in `run'' /usr/local/bin/rake:31:in `<main>'' -- Posted via http://www.ruby-forum.com/.
fernanda.aispuro
2009-Aug-24 22:05 UTC
Re: Error: uninitialized constant MysqlCompat::MysqlRes
Hi there, I just started using aptana and am working on my HelloWorld, but I''m gettin the same error "uninitialized constant MysqlCompat::MysqlRes". Did you ever figure out what is it about? Thanks! On Jul 31, 12:00 pm, "Martin J." <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, > I installed the "kwatch-mysql-ruby" gem on my Debian server but when I > try to run the "db:migrate" task I get the following error: > > ** Invoke db:migrate (first_time) > ** Invoke environment (first_time) > ** Execute environment > ** Execute db:migrate > rake aborted! > uninitialized constant MysqlCompat::MysqlRes > /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:440:in > `rescue in load_missing_constant'' > /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:436:in > `load_missing_constant'' > /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:80:in > `const_missing_with_dependencies'' > /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/mysql_adapter.rb:9:in > `define_all_hashes_method!'' > /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/mysql_adapter.rb:71:in > `mysql_connection'' > /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in > `new_connection'' > /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in > `checkout_new_connection'' > /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in > `block (2 levels) in checkout'' > /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in > `loop'' > /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in > `block in checkout'' > /usr/local/lib/ruby/1.9.1/monitor.rb:190:in `mon_synchronize'' > /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in > `checkout'' > /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in > `connection'' > /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in > `retrieve_connection'' > /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in > `retrieve_connection'' > /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in > `connection'' > /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/migration.rb:435:in > `initialize'' > /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/migration.rb:400:in > `new'' > /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/migration.rb:400:in > `up'' > /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/migration.rb:383:in > `migrate'' > /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.3/lib/tasks/databases.rake:116:in > `block (2 levels) in <top (required)>'' > /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `call'' > /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `block > in execute'' > /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `each'' > /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in > `execute'' > /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:597:in `block > in invoke_with_call_chain'' > /usr/local/lib/ruby/1.9.1/monitor.rb:190:in `mon_synchronize'' > /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:590:in > `invoke_with_call_chain'' > /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:583:in > `invoke'' > /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2051:in > `invoke_task'' > /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in > `block (2 levels) in top_level'' > /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in > `each'' > /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in > `block in top_level'' > /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in > `standard_exception_handling'' > /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2023:in > `top_level'' > /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2001:in > `block in run'' > /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in > `standard_exception_handling'' > /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:1998:in `run'' > /usr/local/bin/rake:31:in `<main>'' > -- > Posted viahttp://www.ruby-forum.com/.
Caleb Cullen
2009-Aug-27 18:07 UTC
Re: Error: uninitialized constant MysqlCompat::MysqlRes
Martin J. wrote:> Hi, > I installed the "kwatch-mysql-ruby" gem on my Debian server but when I > try to run the "db:migrate" task I get the following error: > > ** Invoke db:migrate (first_time) > ** Invoke environment (first_time) > ** Execute environment > ** Execute db:migrate > rake aborted! > uninitialized constant MysqlCompat::MysqlResI saw this, having freshly installed Rails 2.3.3, and then being told to run ''gem install mysql'' because the MySQL client is no longer bundled with Rails, as of 2.2 Okay, I did that. Then I got the error message you showed in your post -- about MysqlCompat::MysqlRes not being defined. Turns out there is no such thing; this error is caused by a malfunction of the mysql-2.8.1 gem. If you install the gem by hand, chances are when you run the test you''ll find that the gem''s bundle doesn''t actually manage to load the mysqlclient library. (On my MacOS X 10.5.8 system, it''s a .dylib; under Linux it may be a .so) The error message I saw during the test phase looked like this: ./mysql.bundle: dlopen(./mysql.bundle, 9): Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib (LoadError) Referenced from: /Users/ccullen/Projects/npapp-v2/mysql-ruby-2.8.1/mysql.bundle Reason: image not found - ./mysql.bundle from test.rb:5 From that message you can see it''s looking for the mysqlclient library in a directory one level too deep, vis-a-vis the location my libraries occupy: /usr/local/mysql/lib is right; /usr/local/mysql/lib/mysql is not. It is however pretty simple to create a ''mysql'' symlink inside /usr/local/mysql/lib and point it at ''.'', allowing the broken mysql.bundle to locate its libraries. This is definitely a hack. I just wanted to help, since I haven''t seen any answers posted, and certainly nothing to explain why this error is occurring. Best of luck! -- Posted via http://www.ruby-forum.com/.
To fix this, specify ARCHFLAGS when you install the ''mysql'' gem: sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql- config=/usr/local/mysql/bin/mysql_config On Aug 27, 12:07 pm, Caleb Cullen <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Martin J. wrote: > > Hi, > > I installed the "kwatch-mysql-ruby" gem on my Debian server but when I > > try to run the "db:migrate" task I get the following error: > > > ** Invoke db:migrate (first_time) > > ** Invoke environment (first_time) > > ** Execute environment > > ** Execute db:migrate > > rake aborted! > > uninitialized constant MysqlCompat::MysqlRes > > I saw this, having freshly installed Rails 2.3.3, and then being told to > run ''gem install mysql'' because the MySQL client is no longer bundled > with Rails, as of 2.2 > > Okay, I did that. Then I got the error message you showed in your post > -- about MysqlCompat::MysqlRes not being defined. > > Turns out there is no such thing; this error is caused by a malfunction > of the mysql-2.8.1 gem. > > If you install the gem by hand, chances are when you run the test you''ll > find that the gem''s bundle doesn''t actually manage to load the > mysqlclient library. (On my MacOS X 10.5.8 system, it''s a .dylib; under > Linux it may be a .so) > > The error message I saw during the test phase looked like this: > > ./mysql.bundle: dlopen(./mysql.bundle, 9): Library not loaded: > /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib (LoadError) > Referenced from: > /Users/ccullen/Projects/npapp-v2/mysql-ruby-2.8.1/mysql.bundle > Reason: image not found - ./mysql.bundle > from test.rb:5 > > From that message you can see it''s looking for the mysqlclient library > in a directory one level too deep, vis-a-vis the location my libraries > occupy: > /usr/local/mysql/lib is right; /usr/local/mysql/lib/mysql is not. > > It is however pretty simple to create a ''mysql'' symlink inside > /usr/local/mysql/lib and point it at ''.'', allowing the broken > mysql.bundle to locate its libraries. > > This is definitely a hack. I just wanted to help, since I haven''t seen > any answers posted, and certainly nothing to explain why this error is > occurring. > > Best of luck! > -- > Posted viahttp://www.ruby-forum.com/.
This didn''t seem to fix the error for me. I still get ''uninitialized constant MysqlCompat::MysqlRes'' Kyle Fox wrote:> To fix this, specify ARCHFLAGS when you install the ''mysql'' gem: > > sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql- > config=/usr/local/mysql/bin/mysql_config > > On Aug 27, 12:07�pm, Caleb Cullen <rails-mailing-l...@andreas-s.net>cheers, -- Posted via http://www.ruby-forum.com/.
I also built the gem with the archflags, but am still getting this error. Did anyone find a different reason that might be causing this? On Sep 19, 11:15 pm, Evan Green <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> This didn''t seem to fix the error for me. I still get ''uninitialized > constant MysqlCompat::MysqlRes'' > > Kyle Fox wrote: > > To fix this, specify ARCHFLAGS when you install the ''mysql'' gem: > > > sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql- > > config=/usr/local/mysql/bin/mysql_config > > > On Aug 27, 12:07 pm, Caleb Cullen <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > cheers, > -- > Posted viahttp://www.ruby-forum.com/.
Evan Green wrote:> This didn''t seem to fix the error for me. I still get ''uninitialized > constant MysqlCompat::MysqlRes'' > > > Kyle Fox wrote: >> To fix this, specify ARCHFLAGS when you install the ''mysql'' gem: >> >> sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql- >> config=/usr/local/mysql/bin/mysql_config >> >> On Aug 27, 12:07�pm, Caleb Cullen <rails-mailing-l...@andreas-s.net> > > > cheers,on my Centos Machine, i had to install mysql-devel.x86_64 first, then i ran the command: env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/lib64/mysql/mysql_config which did the trick. thanks Kyle -- Posted via http://www.ruby-forum.com/.
Jean Bombeur
2009-Sep-30 04:36 UTC
Re: Error: uninitialized constant MysqlCompat::MysqlRes
Anybody still has the issue? I have been using jruby for a while but today I was trying to setup using the last version of ruby 1.9 and rails 2.3.4 and I got hit with that. Also running centos and tried the ARCHFLAGS trick with no success. Pishty Ags wrote:> Evan Green wrote: >> This didn''t seem to fix the error for me. I still get ''uninitialized >> constant MysqlCompat::MysqlRes'' >> >> >> Kyle Fox wrote: >>> To fix this, specify ARCHFLAGS when you install the ''mysql'' gem: >>> >>> sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql- >>> config=/usr/local/mysql/bin/mysql_config >>> >>> On Aug 27, 12:07�pm, Caleb Cullen <rails-mailing-l...@andreas-s.net> >> >> >> cheers, > > on my Centos Machine, i had to install mysql-devel.x86_64 first, then i > ran the command: > > env ARCHFLAGS="-arch x86_64" gem install mysql -- > --with-mysql-config=/usr/lib64/mysql/mysql_config > > which did the trick. > > thanks Kyle-- Posted via http://www.ruby-forum.com/.
Jean Bombeur
2009-Sep-30 04:46 UTC
Re: Error: uninitialized constant MysqlCompat::MysqlRes
Actually, doing more research and an strace on the process I found the problem. Looking in the wrong place for the location of the library, I added my mysql lib directory to ld.so.conf/mysql.conf config file and it fixed it. Jean Bombeur wrote:> Anybody still has the issue? > > I have been using jruby for a while but today I was trying to setup > using the last version of ruby 1.9 and rails 2.3.4 and I got hit with > that. > > Also running centos and tried the ARCHFLAGS trick with no success. > > > Pishty Ags wrote: >> Evan Green wrote: >>> This didn''t seem to fix the error for me. I still get ''uninitialized >>> constant MysqlCompat::MysqlRes'' >>> >>> >>> Kyle Fox wrote: >>>> To fix this, specify ARCHFLAGS when you install the ''mysql'' gem: >>>> >>>> sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql- >>>> config=/usr/local/mysql/bin/mysql_config >>>> >>>> On Aug 27, 12:07�pm, Caleb Cullen <rails-mailing-l...@andreas-s.net> >>> >>> >>> cheers, >> >> on my Centos Machine, i had to install mysql-devel.x86_64 first, then i >> ran the command: >> >> env ARCHFLAGS="-arch x86_64" gem install mysql -- >> --with-mysql-config=/usr/lib64/mysql/mysql_config >> >> which did the trick. >> >> thanks Kyle-- Posted via http://www.ruby-forum.com/.
Hi ************* URGENT PLEASEEEEEEEEEEEEEEEEEEEEEEEEEE *********** I still see the problem after following the above steps. Please please help me. ~Sam. =============================================================================ruby script/server => Booting Mongrel => Rails 2.3.4 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server /!\ FAILSAFE /!\ Mon Oct 12 17:15:15 -0700 2009 Status: 500 Internal Server Error uninitialized constant MysqlCompat::MysqlRes /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dep endencies.rb:440:in `load_missing_constant'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dep endencies.rb:80:in `const_missing'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conne ction_adapters/mysql_adapter.rb:9:in `define_all_hashes_method!'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conne ction_adapters/mysql_adapter.rb:66:in `mysql_connection'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conne ction_adapters/abstract/connection_pool.rb:223:in `send'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conne ction_adapters/abstract/connection_pool.rb:223:in `new_connection'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conne ction_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conne ction_adapters/abstract/connection_pool.rb:188:in `checkout'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conne ction_adapters/abstract/connection_pool.rb:184:in `loop'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conne ction_adapters/abstract/connection_pool.rb:184:in `checkout'' /usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conne ction_adapters/abstract/connection_pool.rb:183:in `checkout'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conne ction_adapters/abstract/connection_pool.rb:98:in `connection'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conne ction_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conne ction_adapters/abstract/connection_specification.rb:123:in `retrieve_connection'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conne ction_adapters/abstract/connection_specification.rb:115:in `connection'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/query _cache.rb:9:in `cache'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/query _cache.rb:28:in `call'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conne ction_adapters/abstract/connection_pool.rb:361:in `call'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/fai lsafe.rb:26:in `call'' /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in `call'' /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in `synchro nize'' /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in `call'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/dis patcher.rb:114:in `call'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/rel oader.rb:34:in `run'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/dis patcher.rb:108:in `call'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/rack/static.rb:31:in `call'' /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:46:in `call'' /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:40:in `each'' /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:40:in `call'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/rack/log_tailer.rb:1 7:in `call'' /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/content_length.rb:13:i n `call'' /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/chunked.rb:15:in `call '' /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/handler/mongrel.rb:61: in `process'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `proce ss_client'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `proce ss_client'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285 ============================================================================= Jean Bombeur wrote:> Actually, doing more research and an strace on the process I found the > problem. > > Looking in the wrong place for the location of the library, I added my > mysql lib directory to ld.so.conf/mysql.conf config file and it fixed > it. > > > Jean Bombeur wrote: >> Anybody still has the issue? >> >> I have been using jruby for a while but today I was trying to setup >> using the last version of ruby 1.9 and rails 2.3.4 and I got hit with >> that. >> >> Also running centos and tried the ARCHFLAGS trick with no success. >> >> >> Pishty Ags wrote: >>> Evan Green wrote: >>>> This didn''t seem to fix the error for me. I still get ''uninitialized >>>> constant MysqlCompat::MysqlRes'' >>>> >>>> >>>> Kyle Fox wrote: >>>>> To fix this, specify ARCHFLAGS when you install the ''mysql'' gem: >>>>> >>>>> sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql- >>>>> config=/usr/local/mysql/bin/mysql_config >>>>> >>>>> On Aug 27, 12:07�pm, Caleb Cullen <rails-mailing-l...@andreas-s.net> >>>> >>>> >>>> cheers, >>> >>> on my Centos Machine, i had to install mysql-devel.x86_64 first, then i >>> ran the command: >>> >>> env ARCHFLAGS="-arch x86_64" gem install mysql -- >>> --with-mysql-config=/usr/lib64/mysql/mysql_config >>> >>> which did the trick. >>> >>> thanks Kyle-- Posted via http://www.ruby-forum.com/.
Raphael Petegrosso
2009-Oct-15 22:48 UTC
Re: Error: uninitialized constant MysqlCompat::MysqlRes
I was having the same problem on Snow Leopard and, after some time I did the following: Removed all mysql gems I had: gem uninstall mysql In my case I had to specify both mysql-dir and mysql-config (and -arch x86_64 to 64 bits) export ARCHFLAGS="-arch i386 -arch x86_64" ; gem install --no-rdoc -- no-ri mysql -- --with-mysql-dir=/usr/local --with-mysql-config=/usr/ local/mysql/bin/mysql_config Hope it works On Oct 12, 9:17 pm, Sam Esam <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi > > ************* URGENT PLEASEEEEEEEEEEEEEEEEEEEEEEEEEE *********** > I still see the problem after following the above steps. > Please please help me. > > ~Sam. > > =========================================================================== ==> ruby script/server > => Booting Mongrel > => Rails 2.3.4 application starting onhttp://0.0.0.0:3000 > => Call with -d to detach > => Ctrl-C to shutdown server > /!\ FAILSAFE /!\ Mon Oct 12 17:15:15 -0700 2009 > Status: 500 Internal Server Error > uninitialized constant MysqlCompat::MysqlRes > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/de p > endencies.rb:440:in `load_missing_constant'' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/de p > endencies.rb:80:in `const_missing'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/mysql_adapter.rb:9:in `define_all_hashes_method!'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/mysql_adapter.rb:66:in `mysql_connection'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_pool.rb:223:in `send'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_pool.rb:223:in `new_connection'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_pool.rb:245:in > `checkout_new_connection'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_pool.rb:188:in `checkout'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_pool.rb:184:in `loop'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_pool.rb:184:in `checkout'' > /usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_pool.rb:183:in `checkout'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_pool.rb:98:in `connection'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_specification.rb:123:in > `retrieve_connection'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_specification.rb:115:in `connection'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/quer y > _cache.rb:9:in `cache'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/quer y > _cache.rb:28:in `call'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_pool.rb:361:in `call'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/fa i > lsafe.rb:26:in `call'' > /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in > `call'' > /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in > `synchro nize'' > /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in > `call'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/di s > patcher.rb:114:in `call'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/re l > oader.rb:34:in `run'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/di s > patcher.rb:108:in `call'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/rack/static.rb:31:i n > `call'' > /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:46:in > `call'' > /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:40:in > `each'' > /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:40:in > `call'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/rack/log_tailer.rb: 1 > 7:in `call'' > /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/content_length.rb:13: i > n `call'' > /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/chunked.rb:15:in > `call '' > /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/handler/mongrel.rb:61 : > in `process'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in > `proce ss_client'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in > `each'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in > `proce ss_client'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in > `run'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285 > =========================================================================== ==> > > > > > Jean Bombeur wrote: > > Actually, doing more research and an strace on the process I found the > > problem. > > > Looking in the wrong place for the location of the library, I added my > > mysql lib directory to ld.so.conf/mysql.conf config file and it fixed > > it. > > > Jean Bombeur wrote: > >> Anybody still has the issue? > > >> I have been using jruby for a while but today I was trying to setup > >> using the last version of ruby 1.9 and rails 2.3.4 and I got hit with > >> that. > > >> Also running centos and tried the ARCHFLAGS trick with no success. > > >> Pishty Ags wrote: > >>> Evan Green wrote: > >>>> This didn''t seem to fix the error for me. I still get ''uninitialized > >>>> constant MysqlCompat::MysqlRes'' > > >>>> Kyle Fox wrote: > >>>>> To fix this, specify ARCHFLAGS when you install the ''mysql'' gem: > > >>>>> sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql- > >>>>> config=/usr/local/mysql/bin/mysql_config > > >>>>> On Aug 27, 12:07 pm, Caleb Cullen <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > >>>> cheers, > > >>> on my Centos Machine, i had to install mysql-devel.x86_64 first, then i > >>> ran the command: > > >>> env ARCHFLAGS="-arch x86_64" gem install mysql -- > >>> --with-mysql-config=/usr/lib64/mysql/mysql_config > > >>> which did the trick. > > >>> thanks Kyle > > -- > Posted viahttp://www.ruby-forum.com/.
Raphael Petegrosso
2009-Oct-15 22:53 UTC
Re: Error: uninitialized constant MysqlCompat::MysqlRes
On Oct 12, 9:17 pm, Sam Esam <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi > > ************* URGENT PLEASEEEEEEEEEEEEEEEEEEEEEEEEEE *********** > I still see the problem after following the above steps. > Please please help me. > > ~Sam. > > =========================================================================== ==> ruby script/server > => Booting Mongrel > => Rails 2.3.4 application starting onhttp://0.0.0.0:3000 > => Call with -d to detach > => Ctrl-C to shutdown server > /!\ FAILSAFE /!\ Mon Oct 12 17:15:15 -0700 2009 > Status: 500 Internal Server Error > uninitialized constant MysqlCompat::MysqlRes > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/de p > endencies.rb:440:in `load_missing_constant'' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/de p > endencies.rb:80:in `const_missing'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/mysql_adapter.rb:9:in `define_all_hashes_method!'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/mysql_adapter.rb:66:in `mysql_connection'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_pool.rb:223:in `send'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_pool.rb:223:in `new_connection'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_pool.rb:245:in > `checkout_new_connection'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_pool.rb:188:in `checkout'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_pool.rb:184:in `loop'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_pool.rb:184:in `checkout'' > /usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_pool.rb:183:in `checkout'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_pool.rb:98:in `connection'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_specification.rb:123:in > `retrieve_connection'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_specification.rb:115:in `connection'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/quer y > _cache.rb:9:in `cache'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/quer y > _cache.rb:28:in `call'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/conn e > ction_adapters/abstract/connection_pool.rb:361:in `call'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/fa i > lsafe.rb:26:in `call'' > /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in > `call'' > /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in > `synchro nize'' > /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in > `call'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/di s > patcher.rb:114:in `call'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/re l > oader.rb:34:in `run'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/di s > patcher.rb:108:in `call'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/rack/static.rb:31:i n > `call'' > /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:46:in > `call'' > /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:40:in > `each'' > /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:40:in > `call'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/rack/log_tailer.rb: 1 > 7:in `call'' > /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/content_length.rb:13: i > n `call'' > /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/chunked.rb:15:in > `call '' > /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/handler/mongrel.rb:61 : > in `process'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in > `proce ss_client'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in > `each'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in > `proce ss_client'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in > `run'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285 > =========================================================================== ==> > > > > > Jean Bombeur wrote: > > Actually, doing more research and an strace on the process I found the > > problem. > > > Looking in the wrong place for the location of the library, I added my > > mysql lib directory to ld.so.conf/mysql.conf config file and it fixed > > it. > > > Jean Bombeur wrote: > >> Anybody still has the issue? > > >> I have been using jruby for a while but today I was trying to setup > >> using the last version of ruby 1.9 and rails 2.3.4 and I got hit with > >> that. > > >> Also running centos and tried the ARCHFLAGS trick with no success. > > >> Pishty Ags wrote: > >>> Evan Green wrote: > >>>> This didn''t seem to fix the error for me. I still get ''uninitialized > >>>> constant MysqlCompat::MysqlRes'' > > >>>> Kyle Fox wrote: > >>>>> To fix this, specify ARCHFLAGS when you install the ''mysql'' gem: > > >>>>> sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql- > >>>>> config=/usr/local/mysql/bin/mysql_config > > >>>>> On Aug 27, 12:07 pm, Caleb Cullen <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > >>>> cheers, > > >>> on my Centos Machine, i had to install mysql-devel.x86_64 first, then i > >>> ran the command: > > >>> env ARCHFLAGS="-arch x86_64" gem install mysql -- > >>> --with-mysql-config=/usr/lib64/mysql/mysql_config > > >>> which did the trick. > > >>> thanks Kyle > > -- > Posted viahttp://www.ruby-forum.com/.
Raphael Petegrosso wrote:> I was having the same problem on Snow Leopard and, after some time I > did the following: > > Removed all mysql gems I had: > > gem uninstall mysql > > In my case I had to specify both mysql-dir and mysql-config (and -arch > x86_64 to 64 bits) > > export ARCHFLAGS="-arch i386 -arch x86_64" ; gem install --no-rdoc -- > no-ri mysql -- --with-mysql-dir=/usr/local --with-mysql-config=/usr/ > local/mysql/bin/mysql_config > > Hope it worksI was able to resolve this issue. Thanks for your valuable suggestions. Along with the above steps, I had to configure the LD_LIBRARY_PATH. -- Posted via http://www.ruby-forum.com/.
Andrew McDonough
2009-Oct-22 14:26 UTC
Re: Error: uninitialized constant MysqlCompat::MysqlRes
These instructions also worked for me after upgrading to Snow Leopard. In my case mysql was in /opt/local/lib/mysql5, so the following fixed it for me: sudo gem uninstall mysql export ARCHFLAGS="-arch i386 -arch x86_64" ; gem install --no-rdoc --no-ri mysql -- --with-mysql-dir=/opt/local/lib/mysql5 --with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config> I was having the same problem on Snow Leopard and, after some time I > did the following: > > Removed all mysql gems I had: > > gem uninstall mysql > > In my case I had to specify both mysql-dir and mysql-config (and -arch > x86_64 to 64 bits) > > export ARCHFLAGS="-arch i386 -arch x86_64" ; gem install --no-rdoc -- > no-ri mysql -- --with-mysql-dir=/usr/local --with-mysql-config=/usr/ > local/mysql/bin/mysql_config > > Hope it works-- Posted via http://www.ruby-forum.com/.
Caleb Cullen
2009-Oct-22 15:33 UTC
Re: Error: uninitialized constant MysqlCompat::MysqlRes
Andrew McDonough wrote:> These instructions also worked for me after upgrading to Snow Leopard. > In my case mysql was in /opt/local/lib/mysql5, so the following fixed it > for me: > > sudo gem uninstall mysql > > export ARCHFLAGS="-arch i386 -arch x86_64" ; gem install --no-rdoc > --no-ri mysql -- --with-mysql-dir=/opt/local/lib/mysql5 > --with-mysql-config=/opt/local/lib/mysql5/bin/mysql_configI was able to get the mysql gem to compile by doing something like that; but then I found that, for whatever reason, /tmp/mysql.sock did not exist (and so my rake tasks failed, etc). I followed instructions on the Rails blog to install MySQL from a DMG, and then /tmp/mysql.sock existed as expected. HTH. -- Posted via http://www.ruby-forum.com/.
grosser.michael
2009-Oct-24 13:01 UTC
Re: Error: uninitialized constant MysqlCompat::MysqlRes
had the same, switching to 2.7 helps sudo gem install mysql -v 2.7 On 22 Okt., 17:33, Caleb Cullen <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Andrew McDonough wrote: > > These instructions also worked for me after upgrading to Snow Leopard. > > In my case mysql was in /opt/local/lib/mysql5, so the following fixed it > > for me: > > > sudo gem uninstall mysql > > > export ARCHFLAGS="-arch i386 -arch x86_64" ; gem install --no-rdoc > > --no-ri mysql -- --with-mysql-dir=/opt/local/lib/mysql5 > > --with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config > > I was able to get the mysql gem to compile by doing something like that; > but then I found that, for whatever reason, /tmp/mysql.sock did not > exist (and so my rake tasks failed, etc). I followed instructions on > the Rails blog to install MySQL from a DMG, and then /tmp/mysql.sock > existed as expected. > > HTH. > -- > Posted viahttp://www.ruby-forum.com/.
Guglielmo Celata
2009-Nov-11 19:12 UTC
Re: Error: uninitialized constant MysqlCompat::MysqlRes
grosser.michael wrote:> had the same, switching to 2.7 helps > sudo gem install mysql -v 2.7 > > On 22 Okt., 17:33, Caleb Cullen <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>I was able to install the mysql v. 2.7 gem on a macport mysql version with: sudo gem install -v 2.7 --no-rdoc --no-ri mysql -- --with-mysql-dir=/opt/local/lib/mysql5 --with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config; -- Posted via http://www.ruby-forum.com/.
Wolfravenous
2009-Dec-16 18:33 UTC
Re: Error: uninitialized constant MysqlCompat::MysqlRes
If you are still getting this issue, I have posted an EXPLANATION as well as how to derive the correct solution for your system here http://techliberty.blogspot.com/ http://techliberty.blogspot.com/ the EXPLANATION was to long for a forum post :) Adam Akhtar-2 wrote:> > > Anybody still has the issue? > > I have been using jruby for a while but today I was trying to setup > using the last version of ruby 1.9 and rails 2.3.4 and I got hit with > that. > > Also running centos and tried the ARCHFLAGS trick with no success. > > > Pishty Ags wrote: >> Evan Green wrote: >>> This didn''t seem to fix the error for me. I still get ''uninitialized >>> constant MysqlCompat::MysqlRes'' >>> >>> >>> Kyle Fox wrote: >>>> To fix this, specify ARCHFLAGS when you install the ''mysql'' gem: >>>> >>>> sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql- >>>> config=/usr/local/mysql/bin/mysql_config >>>> >>>> On Aug 27, 12:07�pm, Caleb Cullen >>> >>> >>> cheers, >> >> on my Centos Machine, i had to install mysql-devel.x86_64 first, then i >> ran the command: >> >> env ARCHFLAGS="-arch x86_64" gem install mysql -- >> --with-mysql-config=/usr/lib64/mysql/mysql_config >> >> which did the trick. >> >> thanks Kyle > > -- > Posted via http://www.ruby-forum.com/. > > --~--~---------~--~----~------------~-------~--~----~ > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en > -~----------~----~----~----~------~----~------~--~--- > > >-- View this message in context: http://old.nabble.com/Error%3A-uninitialized-constant-MysqlCompat%3A%3AMysqlRes-tp24761537p26816101.html Sent from the RubyOnRails Users mailing list archive at Nabble.com. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Roger Collins
2009-Dec-26 15:11 UTC
Re: Error: uninitialized constant MysqlCompat::MysqlRes
This article got it done for me: http://stackoverflow.com/questions/991708/rails-mysql-and-snow-leopard -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Caleb Could I ask what test you were running during the "test phase" you mention below? I''m really stumped by my problems with this bug, and am trying to determine if my error has the same cause. thanks, Rick Caleb Cullen wrote:> Martin J. wrote: >> Hi, >> I installed the "kwatch-mysql-ruby" gem on my Debian server but when I >> try to run the "db:migrate" task I get the following error: >> >> ** Invoke db:migrate (first_time) >> ** Invoke environment (first_time) >> ** Execute environment >> ** Execute db:migrate >> rake aborted! >> uninitialized constant MysqlCompat::MysqlRes > > I saw this, having freshly installed Rails 2.3.3, and then being told to > run ''gem install mysql'' because the MySQL client is no longer bundled > with Rails, as of 2.2 > > Okay, I did that. Then I got the error message you showed in your post > -- about MysqlCompat::MysqlRes not being defined. > > Turns out there is no such thing; this error is caused by a malfunction > of the mysql-2.8.1 gem. > > If you install the gem by hand, chances are when you run the test you''ll > find that the gem''s bundle doesn''t actually manage to load the > mysqlclient library. (On my MacOS X 10.5.8 system, it''s a .dylib; under > Linux it may be a .so) > > The error message I saw during the test phase looked like this: > > ./mysql.bundle: dlopen(./mysql.bundle, 9): Library not loaded: > /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib (LoadError) > Referenced from: > /Users/ccullen/Projects/npapp-v2/mysql-ruby-2.8.1/mysql.bundle > Reason: image not found - ./mysql.bundle > from test.rb:5 > > From that message you can see it''s looking for the mysqlclient library > in a directory one level too deep, vis-a-vis the location my libraries > occupy: > /usr/local/mysql/lib is right; /usr/local/mysql/lib/mysql is not. > > It is however pretty simple to create a ''mysql'' symlink inside > /usr/local/mysql/lib and point it at ''.'', allowing the broken > mysql.bundle to locate its libraries. > > This is definitely a hack. I just wanted to help, since I haven''t seen > any answers posted, and certainly nothing to explain why this error is > occurring. > > Best of luck!-- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>> Pishty Ags wrote: >>> Evan Green wrote: >>>> This didn''t seem to fix the error for me. I still get ''uninitialized >>>> constant MysqlCompat::MysqlRes'' >>>> >>>> >>>> Kyle Fox wrote: >>>>> To fix this, specify ARCHFLAGS when you install the ''mysql'' gem: >>>>> >>>>> sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql- >>>>> config=/usr/local/mysql/bin/mysql_config >>>>> >>>>> On Aug 27, 12:07�pm, Caleb Cullen <rails-mailing-l...@andreas-s.net> >>>> >>>> >>>> cheers, >>> >>> on my Centos Machine, i had to install mysql-devel.x86_64 first, then i >>> ran the command: >>> >>> env ARCHFLAGS="-arch x86_64" gem install mysql -- >>> --with-mysql-config=/usr/lib64/mysql/mysql_config >>> >>> which did the trick. >>> >>> thanks KyleI use Centos , but it''s i386 . So I installd mysql-devel,and use the command: env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/lib/msyql/mysql_config", and it did the work , Aha! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Nikhil Gupte
2010-Jan-28 16:15 UTC
Re: Error: uninitialized constant MysqlCompat::MysqlRes
For all you folks who couldn''t get this to work on Snow Leopard inspite of trying the ridiculously simple solution(s) mentioned above, Try this: Re compile ruby. Then do sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config This will ensure that the *right* arch of ruby is used to compile the native extensions. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Nikhil Gupte wrote:> For all you folks who couldn''t get this to work on Snow Leopard inspite > of trying the ridiculously simple solution(s) mentioned above, > > Try this: > Re compile ruby. Then do > > sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- > --with-mysql-config=/usr/local/mysql/bin/mysql_config > > This will ensure that the *right* arch of ruby is used to compile the > native extensions.and how do you recompile Ruby... New to the OSX platform... Thanks. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard I went through this within the last two days. Might be useful to see my write up here, too: http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/37b593be608e2461/1ace7ea9d30ef28a#1ace7ea9d30ef28a On Feb 24, 7:07 pm, Jean Nibee <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Nikhil Gupte wrote: > > For all you folks who couldn''t get this to work on Snow Leopard inspite > > of trying the ridiculously simple solution(s) mentioned above, > > > Try this: > > Re compile ruby. Then do > > > sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- > > --with-mysql-config=/usr/local/mysql/bin/mysql_config > > > This will ensure that the *right* arch of ruby is used to compile the > > native extensions. > > and how do you recompile Ruby... > > New to the OSX platform... > > Thanks. > -- > Posted viahttp://www.ruby-forum.com/.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Nikhil Gupte
2010-Feb-25 06:36 UTC
Re: Error: uninitialized constant MysqlCompat::MysqlRes
Jean, Best is to install macports, if you aren''t already using it. To re-compile ruby, run: sudo port install ruby -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Mike Montagne
2010-Mar-22 00:45 UTC
mysql gem migrate "Unknown database ''[db_development]" error
Nikhil Gupte wrote:> Jean, > > Best is to install macports, if you aren''t already using it. > > To re-compile ruby, run: > > sudo port install rubyI was able to get mysql gem to install on OSX Leopard without warnings with the --no-rdoc and --no-ri switches; archflags likewise eliminated the uninitialized constant error: sudo gem install mysql --no-rdoc --no-ri -- --with-mysql-config=/usr/local/mysql/bin/mysql_config That hasn''t made my installation functional however. I just rebuilt my entire project with rails myApp -d mysql; I then scaffolded 5 sets of tables (i.e. script/generate scaffold tablename c_code:string c_name:string tran_id:integer priority:integer); I next drag the project directory onto XCode Organizer; create the start server script (script/server); and start the gem server in terminal: gem server. Fine and dandy so far (seemingly). Then I run rake db:migrate to engender the following error: iMacMike:pfmpe mikemontagne$ rake db:migrate --trace (in /Users/mikemontagne/rproj/pfmpe) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate rake aborted! Unknown database ''pfmpe_development'' ---------- database.yml indicates that this is supposed to be the development database. But no such file exists in my project directory. Is this a MySQL server configuration issue? Does anybody understand why this table is not being created? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hassan Schroeder
2010-Mar-22 01:12 UTC
Re: mysql gem migrate "Unknown database ''[db_development]" error
On Sun, Mar 21, 2010 at 5:45 PM, Mike Montagne <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> iMacMike:pfmpe mikemontagne$ rake db:migrate --trace> Unknown database ''pfmpe_development''> database.yml indicates that this is supposed to be the development > database. But no such file exists in my project directory.What file would you expect? This refers to a database, physical location dependent on your MySQL configuration.> Is this a MySQL server configuration issue? Does anybody understand why > this table is not being created?Perhaps you left out the step where you create it? At least I didn''t see it in your post. You can create databases manually through the MySQL CLI console or a number of other tools, or you can run the appropriate rake task. `rake -T` will give you a list of the available tasks. But you *do* have to create it before running your migrations :-) HTH, -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Oren Golan
2010-Jul-06 18:52 UTC
Re: mysql gem migrate "Unknown database ''[db_development]" error
I had this issue after upgrading from ubuntu 9.10 (karmic) to 10.4 (lucid). the solution was to libmysqlclient16-dev: sudo aptitude install libmysqlclient16-dev -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Jatin kumar
2010-Jul-06 19:14 UTC
Re: Re: mysql gem migrate "Unknown database ''[db_development]" error
I am not sure of why this error is coming, but just for a moment, try rake db:create before doing rake db:migrate. It might solve your problem. On Wed, Jul 7, 2010 at 12:22 AM, Oren Golan <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I had this issue after upgrading from ubuntu 9.10 (karmic) to 10.4 > (lucid). > the solution was to libmysqlclient16-dev: > > sudo aptitude install libmysqlclient16-dev > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Sandip Jassar
2010-Jul-10 20:54 UTC
Re: Re: mysql gem migrate "Unknown database ''[db_development]" error
Jatin kumar wrote:> I am not sure of why this error is coming, but just for a moment, try > rake > db:create before doing rake db:migrate. > It might solve your problem.The Mysql::Result constant is defined in the mysql_api gem (.so shared object) - this is located in gems/1.9.1/gems/mysql-2.8.1/ext/mysql_api/mysql_api.so To fix the error the cleanest way I could think of - I created a symbolic link to this object in /usr/lib/ruby/1.9.1/ - which is in Ruby''s $LOAD_PATH variable - which you can see your own version via : irb; puts "#{$LOAD_PATH}"; - None of the solutions people had posted on the web helped me - the main ones I kept seeing were - reinstall the mysql gem with ARCH_FLAGS set differently - and make a symbolic link mysql -> ''.'' because Ruby was looking one directory too deep I''m using Ubuntu Karamic Koala, Ruby 1.9.1, mysql-2.8.1, rails-2.3.5 -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Na Na
2010-Jul-17 06:26 UTC
Re: Re: mysql gem migrate "Unknown database ''[db_development]" error
Using Mac OS X 10.6.4, the solutions above didn''t work for me. I removed the gem, then tried: gem install ruby-mysql instead of the various attempts to get "gem install mysql" to work. At a glance, this appears to have worked, and my ruby on rails is able to access database. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Derek Lei
2010-Jul-22 10:21 UTC
Re: Re: mysql gem migrate "Unknown database ''[db_development]" error
Thanks Na Na, I was able to fix the issue by uninstalling the mysql gem and then installing ruby-mysql gem. Na Na wrote:> Using Mac OS X 10.6.4, the solutions above didn''t work for me. I > removed the gem, then tried: > gem install ruby-mysql > > instead of the various attempts to get "gem install mysql" to work. > > At a glance, this appears to have worked, and my ruby on rails is able > to access database.-- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Leopard 10.6.4. Solved on my side by reinstalling mysql, using the 64bits version instead of the mistakenly installed 32bits. Obvious ? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ben Chatelain
2010-Sep-05 20:25 UTC
Re: Error: uninitialized constant MysqlCompat::MysqlRes
Kyle Fox wrote:> To fix this, specify ARCHFLAGS when you install the ''mysql'' gem: > > sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql- > config=/usr/local/mysql/bin/mysql_config > > On Aug 27, 12:07�pm, Caleb Cullen <rails-mailing-l...@andreas-s.net>Exactly the answer I needed. Thanks! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Kyle Fox wrote:> To fix this, specify ARCHFLAGS when you install the ''mysql'' gem: > > sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql- > config=/usr/local/mysql/bin/mysql_config > > On Aug 27, 12:07�pm, Caleb Cullen <rails-mailing-l...@andreas-s.net>This fixed the problem for me. thanks! -Jason -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks Kyle, worked awesomely on my macosx machine. Kyle Fox wrote in post #846791:> To fix this, specify ARCHFLAGS when you install the ''mysql'' gem: > > sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql- > config=/usr/local/mysql/bin/mysql_config > > On Aug 27, 12:07 pm, Caleb Cullen <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>-- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Sebastian Bring
2010-Dec-30 22:37 UTC
Re: mysql gem migrate "Unknown database ''[db_development]" error
Oren Golan wrote in post #923611:> I had this issue after upgrading from ubuntu 9.10 (karmic) to 10.4 > (lucid). > the solution was to libmysqlclient16-dev: > > sudo aptitude install libmysqlclient16-devAs a Ubuntu user that did the trick for me. Thanks a lot, Oren! Your decision to post this probably saved hours of work for me. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Raphael Petegrosso wrote in post #859937:> I was having the same problem on Snow Leopard and, after some time I > did the following: > > Removed all mysql gems I had: > > gem uninstall mysql > > In my case I had to specify both mysql-dir and mysql-config (and -arch > x86_64 to 64 bits) > > export ARCHFLAGS="-arch i386 -arch x86_64" ; gem install --no-rdoc -- > no-ri mysql -- --with-mysql-dir=/usr/local --with-mysql-config=/usr/ > local/mysql/bin/mysql_config > > Hope it worksI tried this and got the following message (also using Snow Leopard) ERROR: While executing gem ... (Gem::CommandLineError) Please specify at least one gem name (e.g. gem build GEMNAME) -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Stealth35 Stealth35
2011-Feb-13 14:45 UTC
Re: Error: uninitialized constant MysqlCompat::MysqlRes
Michael S. wrote in post #980959:> Raphael Petegrosso wrote in post #859937: > > I tried this and got the following message (also using Snow Leopard) > > ERROR: While executing gem ... (Gem::CommandLineError) > Please specify at least one gem name (e.g. gem build GEMNAME)do : sudo install_name_tool -change libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/lib/mysql_api.bundleruby -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Matthew Werner
2011-Feb-17 00:00 UTC
Re: Error: uninitialized constant MysqlCompat::MysqlRes
Hi All, This has been the most thorough discussion of the topic I''ve found. I''ve spent far too much time trying to get this stupid gem to work. I''m going to post the information i''ve got and I''m praying someone out there will be able to help me.> ruby -vruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]> mysql --versionmysql Ver 14.14 Distrib 5.5.9, for osx10.6 (i386) using readline 5.1> rails -vRails 2.3.5> sudo gem uninstall mysqlSuccessfully uninstalled mysql-2.8.1 Here is where I''ve seen so so (SO) many different recommendations on what to do. I''ve tried damn near everything, both sudo and not, specifying my arch flags and not. I''ll just go with the most thorough:> export ARCHFLAGS="-arch i386" ; sudo gem install --no-rdoc --no-ri mysql ----with-mysql-dir=/usr/local --with-mysql-config=/usr/local/mysql/bin/mysql_config Building native extensions. This could take a while... Successfully installed mysql-2.8.1 1 gem installed> rake db:migrate --trace** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment => Environment: Development ** Execute db:migrate rake aborted! uninitialized constant MysqlCompat::MysqlRes /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:440:in `load_missing_constant'' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in `const_missing'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/mysql_adapter.rb:9:in `define_all_hashes_method!'' I''m lost on what else it could be. I feel like I''ve tried every combination. I''ve tried reinstalling ruby, 64bit of mysql, please help. I''m out of ideas. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
guilherme p.
2011-Mar-04 15:36 UTC
Re: Error: uninitialized constant MysqlCompat::MysqlRes
Hi, After all attempts. I simply uninstall mysql 5.5.9 (64 bits) and all mysql gems. Then install Mysql 5.1.55 (64 bits) and "sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql- config=/usr/local/mysql/bin/mysql_config" and it works on MAC... Hope it helps. Matthew Werner wrote in post #982105:> Hi All, > > This has been the most thorough discussion of the topic I''ve found. I''ve > spent far too much time trying to get this stupid gem to work. I''m going > to post the information i''ve got and I''m praying someone out there will > be able to help me. > >> ruby -v > ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0] >> mysql --version > mysql Ver 14.14 Distrib 5.5.9, for osx10.6 (i386) using readline 5.1 >> rails -v > Rails 2.3.5 >> sudo gem uninstall mysql > Successfully uninstalled mysql-2.8.1 > > Here is where I''ve seen so so (SO) many different recommendations on > what to do. I''ve tried damn near everything, both sudo and not, > specifying my arch flags and not. I''ll just go with the most thorough: > >> export ARCHFLAGS="-arch i386" ; sudo gem install --no-rdoc --no-ri mysql -- > --with-mysql-dir=/usr/local > --with-mysql-config=/usr/local/mysql/bin/mysql_config > Building native extensions. This could take a while... > Successfully installed mysql-2.8.1 > 1 gem installed > >> rake db:migrate --trace > ** Invoke db:migrate (first_time) > ** Invoke environment (first_time) > ** Execute environment > => Environment: Development > ** Execute db:migrate > rake aborted! > uninitialized constant MysqlCompat::MysqlRes >/Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:440:in> `load_missing_constant'' >/Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in> `const_missing'' >/Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/mysql_adapter.rb:9:in> `define_all_hashes_method!'' > > I''m lost on what else it could be. I feel like I''ve tried every > combination. I''ve tried reinstalling ruby, 64bit of mysql, please help. > I''m out of ideas.-- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Mariusz Nowak
2011-Mar-08 12:51 UTC
Re: Error: uninitialized constant MysqlCompat::MysqlRes
Hi, I''ve found the way to install gem with mysql 5.5x on Snow Leopard. Solution is described at: http://lightyearsoftware.com/2011/02/mysql-5-5-on-mac-os-x/ So just modify DYLD_LIBRARY_PATH and it will work - at least it fixed issue on my side Hope that helps. Mariusz Nowak guilherme p. wrote in post #985453:> Hi, > > After all attempts. I simply uninstall mysql 5.5.9 (64 bits) and all > mysql gems. > > Then install Mysql 5.1.55 (64 bits) and > > "sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql- > config=/usr/local/mysql/bin/mysql_config" > > and it works on MAC... > > Hope it helps. > > > Matthew Werner wrote in post #982105: >> Hi All, >> >> This has been the most thorough discussion of the topic I''ve found. I''ve >> spent far too much time trying to get this stupid gem to work. I''m going >> to post the information i''ve got and I''m praying someone out there will >> be able to help me. >> >>> ruby -v >> ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0] >>> mysql --version >> mysql Ver 14.14 Distrib 5.5.9, for osx10.6 (i386) using readline 5.1 >>> rails -v >> Rails 2.3.5 >>> sudo gem uninstall mysql >> Successfully uninstalled mysql-2.8.1 >> >> Here is where I''ve seen so so (SO) many different recommendations on >> what to do. I''ve tried damn near everything, both sudo and not, >> specifying my arch flags and not. I''ll just go with the most thorough: >> >>> export ARCHFLAGS="-arch i386" ; sudo gem install --no-rdoc --no-ri mysql -- >> --with-mysql-dir=/usr/local >> --with-mysql-config=/usr/local/mysql/bin/mysql_config >> Building native extensions. This could take a while... >> Successfully installed mysql-2.8.1 >> 1 gem installed >> >>> rake db:migrate --trace >> ** Invoke db:migrate (first_time) >> ** Invoke environment (first_time) >> ** Execute environment >> => Environment: Development >> ** Execute db:migrate >> rake aborted! >> uninitialized constant MysqlCompat::MysqlRes >> >/Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:440:in>> `load_missing_constant'' >> >/Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in>> `const_missing'' >> >/Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/mysql_adapter.rb:9:in>> `define_all_hashes_method!'' >> >> I''m lost on what else it could be. I feel like I''ve tried every >> combination. I''ve tried reinstalling ruby, 64bit of mysql, please help. >> I''m out of ideas.-- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
After wrestling with this problem for several days I finally got it nailed. 2 things that I have done that made it work: 1. sudo env ARCHFLAGS="-arch x86_64" gem install --no-rdoc --no-ri mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config 2. export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH" I''m on Snow Leopard, and have only 1 MySQL (x86_64) 5.5, and 1 ruby (prepackaged with Snow Leopard) installed. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
If you have tried all the above and it still didn''t work, try the instructions on THIS page: http://lightyearsoftware.com/2011/02/mysql-5-5-on-mac-os-x/comment-page-1/#comment-33204 It worked for me! (Don''t forget to use the "source" command or restart your terminal session after modifying your bash profile.) -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.