I have installed current mysql gem 2.8 I tried these combination but I still
get the error
*sudo gem install mysql -v 2.7 --no-rdoc --no-ri mysql --
--with-mysql-dir=/usr/local
--with-mysql-config=/usr/local/mysql/bin/mysql_config
macbooks-computer:~/desktop/work/myproject/basketball macbook$
script/console
Loading development environment (Rails 2.3.5)
>> Stat.find(:all)
NameError: uninitialized constant MysqlCompat::MysqlRes
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:440:in
`load_missing_constant'
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in
`const_missing'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:9:in
`define_all_hashes_method!'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:68:in
`mysql_connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in
`send'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in
`new_connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in
`checkout_new_connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in
`checkout'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in
`loop'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in
`checkout'
from /usr/local/lib/ruby/1.8/monitor.rb:238:in `synchronize'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in
`checkout'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in
`connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in
`retrieve_connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in
`retrieve_connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in
`connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:3113:in
`quoted_table_name'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1684:in
`construct_finder_sql'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1548:in
`find_every'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:615:in
`find'
from (irb):1>>
sudo gem install mysql --no-rdoc --no-ri mysql --
--with-mysql-dir=/usr/local
--with-mysql-config=/usr/local/mysql/bin/mysql_config
macbooks-computer:~/desktop/work/myproject/basketball macbook$
script/console
Loading development environment (Rails 2.3.5)
>> Stat.find(:all)
NameError: uninitialized constant MysqlCompat::MysqlRes
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:440:in
`load_missing_constant'
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in
`const_missing'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:9:in
`define_all_hashes_method!'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:68:in
`mysql_connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in
`send'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in
`new_connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in
`checkout_new_connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in
`checkout'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in
`loop'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in
`checkout'
from /usr/local/lib/ruby/1.8/monitor.rb:238:in `synchronize'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in
`checkout'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in
`connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in
`retrieve_connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in
`retrieve_connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in
`connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:3113:in
`quoted_table_name'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1684:in
`construct_finder_sql'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1548:in
`find_every'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:615:in
`find'
from (irb):1>>
sudo gem install mysql --no-rdoc --no-ri mysql --
--with-mysql-dir=/usr/local
--with-mysql-config=/usr/local/mysql/bin/mysql_config
--with-mysql-lib=/usr/local/mysql/bin/mysql
*macbooks-computer:~/desktop/work/myproject/basketball macbook$
script/console
Loading development environment (Rails 2.3.5)
>> Stat.find(:all)
NameError: uninitialized constant MysqlCompat::MysqlRes
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:440:in
`load_missing_constant'
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in
`const_missing'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:9:in
`define_all_hashes_method!'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:68:in
`mysql_connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in
`send'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in
`new_connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in
`checkout_new_connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in
`checkout'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in
`loop'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in
`checkout'
from /usr/local/lib/ruby/1.8/monitor.rb:238:in `synchronize'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in
`checkout'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in
`connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in
`retrieve_connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in
`retrieve_connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in
`connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:3113:in
`quoted_table_name'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1684:in
`construct_finder_sql'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1548:in
`find_every'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:615:in
`find'
from (irb):1>>
*sudo gem install mysql -v 2.7 --no-rdoc --no-ri mysql --
--with-mysql-dir=/usr/local
--with-mysql-config=/usr/local/mysql/bin/mysql_config
--with-mysql-lib=/usr/local/mysql/bin/mysql*
macbooks-computer:~/desktop/work/myproject/basketball macbook$
script/console
Loading development environment (Rails 2.3.5)
>> Stat.find(:all)
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please
install the mysql gem and try again: gem install mysql.
LoadError: Failed to lookup Init function
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle
from /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
`require'
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in
`new_constants_in'
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
`require'
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/requires.rb:7:in
`require_library_or_gem'
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/reporting.rb:11:in
`silence_warnings'
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/requires.rb:5:in
`require_library_or_gem'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:61:in
`mysql_connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in
`send'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in
`new_connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in
`checkout_new_connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in
`checkout'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in
`loop'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in
`checkout'
from /usr/local/lib/ruby/1.8/monitor.rb:238:in `synchronize'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in
`checkout'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in
`connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in
`retrieve_connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in
`retrieve_connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in
`connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:3113:in
`quoted_table_name'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1684:in
`construct_finder_sql'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1548:in
`find_every'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:615:in
`find'
from (irb):1>>
*here are my gems:*
abstract (1.0.0)
actionmailer (2.3.5, 2.0.2, 1.3.3)
actionpack (2.3.5, 2.0.2, 1.13.3)
actionwebservice (1.2.3)
active_form (0.0.6)
activemerchant (1.3.2)
activerecord (2.3.5, 2.0.2, 1.15.3)
activeresource (2.3.5, 2.0.2)
activesupport (2.3.5, 2.0.2, 1.4.2)
builder (2.1.2)
bundler (0.9.11)
camping (1.5.180)
capistrano (2.5.14, 2.1.0, 1.4.1)
cgi_multipart_eof_fix (2.5.0, 2.2, 2.1)
color (1.4.1)
contacts (1.0.12, 1.0.11)
crack (0.1.6)
curb (0.1.4)
daemons (1.0.9, 1.0.7, 1.0.6)
erubis (2.6.5)
facebooker (1.0.64)
fastercsv (1.5.0)
fastthread (1.0.1, 1.0)
gem_plugin (0.2.3, 0.2.2)
gemcutter (0.5.0)
git (1.2.5)
google-geocode (1.2.1)
googlecharts (1.5.1)
hashie (0.1.8)
highline (1.4.0, 1.2.9)
hobo (0.7.5)
hobofields (0.7.5)
hobosupport (0.7.5)
hoe (1.12.2, 1.8.2, 1.8.1, 1.5.0)
hpricot (0.8.1)
httparty (0.5.2)
jeweler (1.4.0)
json (1.1.2)
json_pure (1.2.0)
linkedin (0.1.7)
login_generator (1.2.2)
markaby (0.5)
mechanize (0.9.2)
metaid (1.0)
mime-types (1.15)
mini_magick (1.2.3)
mongrel (1.1.3, 1.0.1)
mongrel_cluster (1.0.5, 1.0.2, 0.2.1)
mysql (2.8.1)
needle (1.3.0)
net-scp (1.0.2)
net-sftp (2.0.4, 1.1.0)
net-ssh (2.0.19, 1.1.2, 1.1.1)
net-ssh-gateway (1.0.1)
nokogiri (1.4.1, 1.3.0)
oauth (0.3.6)
pdf-writer (1.1.8)
racc (1.4.6)
rack (1.0.1)
rails (2.3.5, 2.0.2, 1.2.3)
railsmachine (1.0.6, 1.0.0, 0.1.2)
rake (0.8.7, 0.8.3, 0.8.1, 0.7.3)
rake-compiler (0.5.0)
rc-rest (2.2.1)
RedCloth (4.2.2, 3.0.4)
rflickr (2006.02.01)
rmagick (1.15.7)
roxml (3.1.5)
rspec (1.1.11)
ruby-debug (0.10.0)
ruby-debug-base (0.10.0)
ruby-hmac (0.4.0)
ruby-ole (1.2.10)
ruby-openid (2.0.2, 1.1.4)
ruby-yadis (0.3.4)
ruby_parser (2.0.4)
rubyforge (2.0.3, 1.0.3, 1.0.1, 0.4.4)
rubygems-update (1.3.6)
rufus-cloche (0.1.13)
rufus-dollar (1.0.2)
rufus-json (0.1.0)
rufus-lru (1.0.2)
rufus-mnemo (1.1.1)
rufus-scheduler (2.0.3)
rufus-treechecker (1.0.3)
ruote (2.1.1)
scrubyt (0.4.06)
sexp_processor (3.0.3)
sinatra (0.9.4)
sources (0.0.1)
spreadsheet-excel (0.3.5.1)
tenderlove-frex (1.0.1.20090313144615)
termios (0.9.4)
test-spec (0.10.0)
transaction-simple (1.4.0)
twitter (0.8.6)
tzinfo (0.3.3)
validatable (1.6.7)
will_paginate (2.2.2)
xml-simple (1.0.11)
ym4r (0.6.0)
youtube-g (0.4.9.9)
ZenTest (4.2.1, 3.9.1)
Do you guys have any suggestion?
Yudi Soesanto
On Mon, Mar 15, 2010 at 7:32 AM, Yudi Soesanto <[email protected]> wrote:
> I removed mysql 2.8 gem and reinstall mysql 2.7 with this command:
>
> *sudo gem install mysql -v 2.7 --no-rdoc --no-ri mysql --
> --with-mysql-dir=/usr/local
> --with-mysql-config=/usr/local/mysql/bin/mysql_config*
>
> Now, when I run rake db:create, it will give me this error:
> !!! The bundled mysql.rb driver has been removed from Rails 2.2. Please
> install the mysql gem and try again: gem install mysql.
> rake aborted!
> Failed to lookup Init function
> /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle
>
> (See full trace by running task with --trace)
>
> any idea?
>
> Yudi Soesanto
>
>
>
> On Mon, Mar 15, 2010 at 6:56 AM, Yudi Soesanto <[email protected]> wrote:
>
>> Ok, I did require 'rubygems' and then require 'mysql'. They are return
>> true
>>
>> *irb(main):001:0> require 'rubygems'
>> => true
>> irb(main):002:0> require 'mysql'
>> => true*
>>
>> Is that mean mysql gem ok? Please be advise.
>>
>>
>>
>> On Mon, Mar 15, 2010 at 6:40 AM, Frederick Cheung <
>> [email protected]> wrote:
>>
>>>
>>>
>>> On Mar 15, 10:29 am, Yudi Soesanto <[email protected]> wrote:
>>> > Ok, used 2 different command: irb and ruby script/console.
>>> >
>>> > *I use irb and run this command:*
>>> > irb(main):001:0> require 'mysql'
>>> > LoadError: no such file to load -- mysql
>>> > from (irb):1:in `require'
>>> > from (irb):1
>>> >
>>> You need to require rubygems first (Keep an eye on the system logs (in
>>> the console app) while you do this
>>>
>>> The main difference between 2.0.2 and 2.3.5 is that 2.3.4 no longer
>>> has a fallback version of the mysql driver (written in ruby) - it's
>>> likely that your mysql driver has never been properly installed.
>>>
>>> Fred
>>>
>>> --
>>> 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 [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected]<rubyonrails-talk%[email protected]>
>>> .
>>> 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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.