From: Todd Benson Date: 2007-07-26T13:22:33+09:00 Subject: Re: Ruby error - cannot find ruby gem active record On 7/25/07, jmilunsky@hotmail.com wrote: > Things seem to have gotten worse for me. I had it working at one point > now i have installed everything from scratch again nad I get the > following error - i am running windows > > C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/ > vendor/mysql.rb:111:in `initialize': Bad file descriptor - connect(2) > (Errno::EBADF) > from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ > active_record/vendor/mysql.rb:111:in `real_connect' > from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ > active_record/connection_adapters/mysql_adapter.rb:389:in `connect' > from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ > active_record/connection_adapters/mysql_adapter.rb:152:in `initialize' > from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ > active_record/connection_adapters/mysql_adapter.rb:82:in > `mysql_connection' > from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ > active_record/connection_adapters/abstract/connection_specification.rb: > 262:in `connection_without_query_cache=' > from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ > active_record/query_cache.rb:54:in `connection=' > from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ > active_record/connection_adapters/abstract/connection_specification.rb: > 230:in `retrieve_connection' > from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ > active_record/connection_adapters/abstract/connection_specification.rb: > 78:in `connection' > from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ > active_record/base.rb:763:in `columns' > from C:/RadRails/workspace/album/my_ruby_code.rb:9 > > > I installed ruby 1.8.4-20 into c:\ruby > I then installed rails using gem insall rails -r -y > I have the preference in RadRails set correctly to point to these > directories but it seems as though it's looking for active record in a > different directory or something No, this is a connection error. I can reproduce this by establishing a connection with 'mysql' (even though I don't have MySQL installed). Then, when I try to query through ActiveRecord, it gives me that error. Check - your database.yml file - that your mysql server is running