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

*
When I use ruby script/console,*
>> require 'mysql'
=> ["Mysql"]

*Here additional info*
*OS and mysql information:*
- Mac X tiger
- mysql version 5
*
Gem Version*
- ruby v 1.8.6
- rails v 2.3.5
- rake v 0.8.7
- mysql v 2.8.1
- gem v 1.3.6
- activesupport v 2.3.5
- activerecord v 2.3.5
- actionpack v 2.3.5

*File location*
- ruby is in /usr/local/bin/ruby
- mysql is in /usr/local/mysql/bin/mysql
- gem is in /usr/local/bin/gem
- rake is in /usr/local/bin/rake

Note:
- My previous rails was version 2.0.2 and I just upgraded to v2.3.5
- I reinstall mysql gem

Any thought?


On Mon, Mar 15, 2010 at 6:13 AM, Frederick Cheung <
frederick.che...@gmail.com> wrote:

>
>
> On Mar 15, 10:06 am, Yudi Soesanto <soesa...@gmail.com> wrote:
> > *from my existing rails application (I created from previous rails
> 2.0.2), I
> > got this error when I run my application.*
> >
> > NameError: uninitialized constant MysqlCompat::MysqlRes
>
> That usually means that it couldn't load the mysql C extension. I'd
> double check that the gem was installed in the right install of ruby
> (there's another one that is part of Mac OS X itself). Also work
> opening an irb console and requiring the mysql gem, see if you get a
> more explicit error message or warning in the console logs.
>
> Fred
>
> >         from
> >
> /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/de
> pendencies.rb:440:in
> > `load_missing_constant'
> >         from
> >
> /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/de
> pendencies.rb:80:in
> > `const_missing'
> >         from
> >
> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/conn
> ection_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/conn
> ection_adapters/mysql_adapter.rb:68:in
> > `mysql_connection'
> >         from
> >
> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/conn
> ection_adapters/abstract/connection_pool.rb:223:in
> > `send'
> >         from
> >
> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/conn
> ection_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/conn
> ection_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/conn
> ection_adapters/abstract/connection_pool.rb:188:in
> > `checkout'
> >         from
> >
> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/conn
> ection_adapters/abstract/connection_pool.rb:184:in
> > `loop'
> >         from
> >
> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/conn
> ection_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/conn
> ection_adapters/abstract/connection_pool.rb:183:in
> > `checkout'
> >         from
> >
> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/conn
> ection_adapters/abstract/connection_pool.rb:98:in
> > `connection'
> >         from
> >
> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/conn
> ection_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/conn
> ection_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/conn
> ection_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>>
> >
> > *I created a new rails app and run rake db:create, I got this error*
> >
> > Couldn't create database for {"socket"=>"/tmp/mysql.sock",
> > "reconnect"=>false, "encoding"=>"utf8", "username"=>"root",
> > "adapter"=>"mysql", "password"=>nil, "database"=>"myrail_development",
> > "pool"=>5}, charset: utf8, collation: utf8_unicode_ci (if you set the
> > charset manually, make sure you have a matching collation)
> >
> > Any thought?
> >
> > On Mon, Mar 15, 2010 at 5:55 AM, Frederick Cheung <
> >
> >
> >
> > frederick.che...@gmail.com> wrote:
> >
> > > On Mar 15, 5:42 am, Yudi Soesanto <soesa...@gmail.com> wrote:
> > > > I just upgraded rails 2.3.5 and I got the error when I tried to run
> my
> > > > application.
> >
> > > What error ?
> >
> > > Fred
> >
> > > > Here few information:
> > > > - My OS Mac Tiger
> > > > - Rails version 2.3.5
> > > > - Ruby version ruby 1.8.6
> > > > - gem version 1.3.6
> >
> > > > - I run command: which rails
> > > >   >> /usr/local/bin/rails
> >
> > > > - I run command: which ruby
> > > >   >> /usr/local/bin/ruby
> >
> > > > - I run command: which mysql
> > > >   >> /usr/local/mysql/bin/mysql
> >
> > > > I spent more than 7 hours to figure out and tried different things,
> but I
> > > > still got error
> > > > I use this command, and still not working
> > > > *sudo gem install mysql -v 2.7 --
> > > > --with-mysql-include=/usr/local/mysql/include/mysql
> > > > --with-mysql-lib=/usr/local/mysql/bin/mysql --with-mysql
> > > > config=/usr/local/mysql/bin/mysql_config*
> >
> > > > or
> >
> > > > sudo gem install mysql --
> > > > --with-mysql-config=/usr/local/mysql/bin/mysql_config
> >
> > > > Please help!!!
> >
> > > > Yudi
> >
> > > --
> > > 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@googlegroups.com
> .
> > > To unsubscribe from this group, send email to
> > > rubyonrails-talk+unsubscr...@googlegroups.com<rubyonrails-talk%2bunsubscr...@googlegroups.com><rubyonrails-talk%2Bunsubscrib
> e...@googlegroups.com>
> > > .
> > > 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com<rubyonrails-talk%2bunsubscr...@googlegroups.com>
> .
> 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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to