I''m just getting started with Rails, and I''m having trouble getting everything set up correctly. I have installed Ruby 1.8.4, Rails 1.1.6, and MySQL 5.0. I am able to create a rails app, start WEBrick, and see the default page, but I cannot get Rails to play nice with MySQL. I have not created any migrations, but when I run "rake db:migrate" just to see if everything is wired up correctly, I get a cryptic error: C:\rails_apps\test_app>mysqladmin -u root create test_app_development C:\rails_apps\test_app>rake db:migrate (in C:/rails_apps/test_app) rake aborted! Bad file descriptor - connect(2) My database.yml file contains the defaults: development: adapter: mysql database: test_app_development username: root password: host: localhost And I am able to connect to MySQL through the command line: C:\rails_apps\test_app>mysql -u root test_app_development mysql> create table dummy(i int); Query OK, 0 rows affected (0.16 sec) mysql> drop table dummy; Query OK, 0 rows affected (0.03 sec) I should also note that I can use InstantRails without a problem - I''d just really like to be able to get it working manually. Any thoughts? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hmm, you didn''t mention it so I''ll suggest giving rake db:migrate --trace a try to see if the extra verbosity will reap any clues. On 9/16/06, Adam McCrea <adam.mccrea-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > I''m just getting started with Rails, and I''m having trouble getting > everything set up correctly. I have installed Ruby 1.8.4, Rails 1.1.6, > and MySQL 5.0. I am able to create a rails app, start WEBrick, and see > the default page, but I cannot get Rails to play nice with MySQL. I > have not created any migrations, but when I run "rake db:migrate" just > to see if everything is wired up correctly, I get a cryptic error: > > C:\rails_apps\test_app>mysqladmin -u root create test_app_development > C:\rails_apps\test_app>rake db:migrate > (in C:/rails_apps/test_app) > rake aborted! > Bad file descriptor - connect(2) > > My database.yml file contains the defaults: > > development: > adapter: mysql > database: test_app_development > username: root > password: > host: localhost > > And I am able to connect to MySQL through the command line: > > C:\rails_apps\test_app>mysql -u root test_app_development > mysql> create table dummy(i int); > Query OK, 0 rows affected (0.16 sec) > mysql> drop table dummy; > Query OK, 0 rows affected (0.03 sec) > > I should also note that I can use InstantRails without a problem - I''d > just really like to be able to get it working manually. Any thoughts? > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks for the response, Collin... here is the verbose output: C:\rails_apps\test_app>rake db:migrate --trace (in C:/rails_apps/test_app) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate rake aborted! Bad file descriptor - connect(2) c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysq l.rb:108:in `initialize'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysq l.rb:108:in `real_connect'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_ adapters/mysql_adapter.rb:330:in `connect'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_ adapters/mysql_adapter.rb:87:in `initialize'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_ adapters/mysql_adapter.rb:36:in `mysql_connection'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_ adapters/abstract/connection_specification.rb:251:in `connection_without_query_c ache='' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/query_cache .rb:54:in `connection='' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_ adapters/abstract/connection_specification.rb:220:in `retrieve_connection'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_ adapters/abstract/connection_specification.rb:78:in `connection'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r b:282:in `migrate'' c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/tasks/databases.rake:4 c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute'' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute'' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in `invoke'' c:/ruby/lib/ruby/1.8/thread.rb:135:in `synchronize'' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke'' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run'' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run'' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7 c:/ruby/bin/rake.bat:25 Collin Miller wrote:> Hmm, you didn''t mention it so I''ll suggest giving > > rake db:migrate --trace > > a try to see if the extra verbosity will reap any clues. > > On 9/16/06, Adam McCrea <adam.mccrea-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > I''m just getting started with Rails, and I''m having trouble getting > > everything set up correctly. I have installed Ruby 1.8.4, Rails 1.1.6, > > and MySQL 5.0. I am able to create a rails app, start WEBrick, and see > > the default page, but I cannot get Rails to play nice with MySQL. I > > have not created any migrations, but when I run "rake db:migrate" just > > to see if everything is wired up correctly, I get a cryptic error: > > > > C:\rails_apps\test_app>mysqladmin -u root create test_app_development > > C:\rails_apps\test_app>rake db:migrate > > (in C:/rails_apps/test_app) > > rake aborted! > > Bad file descriptor - connect(2) > > > > My database.yml file contains the defaults: > > > > development: > > adapter: mysql > > database: test_app_development > > username: root > > password: > > host: localhost > > > > And I am able to connect to MySQL through the command line: > > > > C:\rails_apps\test_app>mysql -u root test_app_development > > mysql> create table dummy(i int); > > Query OK, 0 rows affected (0.16 sec) > > mysql> drop table dummy; > > Query OK, 0 rows affected (0.03 sec) > > > > I should also note that I can use InstantRails without a problem - I''d > > just really like to be able to get it working manually. Any thoughts? > > > > > > > > > > > ------=_Part_258621_1352532.1158441734593 > Content-Type: text/html; charset=ISO-8859-1 > X-Google-AttachSize: 1873 > > Hmm, you didn''t mention it so I''ll suggest giving<br><br>rake db:migrate --trace<br><br>a try to see if the extra verbosity will reap any clues.<br><br><div><span class="gmail_quote">On 9/16/06, <b class="gmail_sendername"> > Adam McCrea</b> <<a href="mailto:adam.mccrea-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org">adam.mccrea-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> > <br>I''m just getting started with Rails, and I''m having trouble getting<br>everything set up correctly. I have installed Ruby 1.8.4, Rails 1.1.6,<br>and MySQL 5.0. I am able to create a rails app, start WEBrick, and see > <br>the default page, but I cannot get Rails to play nice with MySQL. I<br>have not created any migrations, but when I run "rake db:migrate" just<br>to see if everything is wired up correctly, I get a cryptic error: > <br><br>C:\rails_apps\test_app>mysqladmin -u root create test_app_development<br>C:\rails_apps\test_app>rake db:migrate<br>(in C:/rails_apps/test_app)<br>rake aborted!<br>Bad file descriptor - connect(2)<br><br>My database.yml > file contains the defaults:<br><br>development:<br> adapter: mysql<br> database: test_app_development<br> username: root<br> password:<br> host: localhost<br><br>And I am able to connect to MySQL through the command line: > <br><br>C:\rails_apps\test_app>mysql -u root test_app_development<br>mysql> create table dummy(i int);<br>Query OK, 0 rows affected (0.16 sec)<br>mysql> drop table dummy;<br>Query OK, 0 rows affected (0.03 sec)<br> > <br>I should also note that I can use InstantRails without a problem - I''d<br>just really like to be able to get it working manually. Any thoughts?<br><br><br><br><br></blockquote></div><br> > > ------=_Part_258621_1352532.1158441734593----~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
1 - try adding to database.yml port: 3306 2 - did you install mysql gem? Craig On Sun, 2006-09-17 at 01:08 +0000, Adam McCrea wrote:> Thanks for the response, Collin... here is the verbose output: > > C:\rails_apps\test_app>rake db:migrate --trace > (in C:/rails_apps/test_app) > ** Invoke db:migrate (first_time) > ** Invoke environment (first_time) > ** Execute environment > ** Execute db:migrate > rake aborted! > Bad file descriptor - connect(2) > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysq > l.rb:108:in `initialize'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysq > l.rb:108:in `real_connect'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_ > adapters/mysql_adapter.rb:330:in `connect'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_ > adapters/mysql_adapter.rb:87:in `initialize'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_ > adapters/mysql_adapter.rb:36:in `mysql_connection'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_ > adapters/abstract/connection_specification.rb:251:in > `connection_without_query_c > ache='' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/query_cache > .rb:54:in `connection='' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_ > adapters/abstract/connection_specification.rb:220:in > `retrieve_connection'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_ > adapters/abstract/connection_specification.rb:78:in `connection'' > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r > b:282:in `migrate'' > c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/tasks/databases.rake:4 > c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute'' > c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute'' > c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in `invoke'' > c:/ruby/lib/ruby/1.8/thread.rb:135:in `synchronize'' > c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke'' > c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run'' > c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run'' > c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7 > c:/ruby/bin/rake.bat:25 > > Collin Miller wrote: > > Hmm, you didn''t mention it so I''ll suggest giving > > > > rake db:migrate --trace > > > > a try to see if the extra verbosity will reap any clues. > > > > On 9/16/06, Adam McCrea <adam.mccrea-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > I''m just getting started with Rails, and I''m having trouble getting > > > everything set up correctly. I have installed Ruby 1.8.4, Rails 1.1.6, > > > and MySQL 5.0. I am able to create a rails app, start WEBrick, and see > > > the default page, but I cannot get Rails to play nice with MySQL. I > > > have not created any migrations, but when I run "rake db:migrate" just > > > to see if everything is wired up correctly, I get a cryptic error: > > > > > > C:\rails_apps\test_app>mysqladmin -u root create test_app_development > > > C:\rails_apps\test_app>rake db:migrate > > > (in C:/rails_apps/test_app) > > > rake aborted! > > > Bad file descriptor - connect(2) > > > > > > My database.yml file contains the defaults: > > > > > > development: > > > adapter: mysql > > > database: test_app_development > > > username: root > > > password: > > > host: localhost > > > > > > And I am able to connect to MySQL through the command line: > > > > > > C:\rails_apps\test_app>mysql -u root test_app_development > > > mysql> create table dummy(i int); > > > Query OK, 0 rows affected (0.16 sec) > > > mysql> drop table dummy; > > > Query OK, 0 rows affected (0.03 sec) > > > > > > I should also note that I can use InstantRails without a problem - I''d > > > just really like to be able to get it working manually. Any thoughts? > > > > > > > > > > > > > > > > > ------=_Part_258621_1352532.1158441734593 > > Content-Type: text/html; charset=ISO-8859-1 > > X-Google-AttachSize: 1873 > > > > Hmm, you didn''t mention it so I''ll suggest giving<br><br>rake db:migrate --trace<br><br>a try to see if the extra verbosity will reap any clues.<br><br><div><span class="gmail_quote">On 9/16/06, <b class="gmail_sendername"> > > Adam McCrea</b> <<a href="mailto:adam.mccrea-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org">adam.mccrea-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> > > <br>I''m just getting started with Rails, and I''m having trouble getting<br>everything set up correctly. I have installed Ruby 1.8.4, Rails 1.1.6,<br>and MySQL 5.0. I am able to create a rails app, start WEBrick, and see > > <br>the default page, but I cannot get Rails to play nice with MySQL. I<br>have not created any migrations, but when I run "rake db:migrate" just<br>to see if everything is wired up correctly, I get a cryptic error: > > <br><br>C:\rails_apps\test_app>mysqladmin -u root create test_app_development<br>C:\rails_apps\test_app>rake db:migrate<br>(in C:/rails_apps/test_app)<br>rake aborted!<br>Bad file descriptor - connect(2)<br><br>My database.yml > > file contains the defaults:<br><br>development:<br> adapter: mysql<br> database: test_app_development<br> username: root<br> password:<br> host: localhost<br><br>And I am able to connect to MySQL through the command line: > > <br><br>C:\rails_apps\test_app>mysql -u root test_app_development<br>mysql> create table dummy(i int);<br>Query OK, 0 rows affected (0.16 sec)<br>mysql> drop table dummy;<br>Query OK, 0 rows affected (0.03 sec)<br> > > <br>I should also note that I can use InstantRails without a problem - I''d<br>just really like to be able to get it working manually. Any thoughts?<br><br><br><br><br></blockquote></div><br> > > > > ------=_Part_258621_1352532.1158441734593-- > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Same result after adding port 3306. I had not installed the mysql gem, but I just tried that (v2.7.1) and got a different error: C:\rails_apps\test_app>rake db:migrate --trace (in C:/rails_apps/test_app) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate rake aborted! Can''t connect to MySQL server on ''127.0.0.1'' (10061) c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_ adapters/mysql_adapter.rb:330:in `real_connect'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_ adapters/mysql_adapter.rb:330:in `connect'' ... I tried this with both "localhost" and "127.0.0.1" specified in my database.yml, and also with and without the port you suggested. From what I''ve read, it sounds like a lot of people have problems with the mysql gem on Windows, so I also tried this Mysql/Ruby adapter: http://www.vandomburg.net/pages/mysql-ruby-windows. Unfortunately, I''m still getting the "Can''t connect to MySQL server" message with this adapter. Craig White wrote:> 1 - try adding to database.yml > > port: 3306 > > 2 - did you install mysql gem? > > Craig > > On Sun, 2006-09-17 at 01:08 +0000, Adam McCrea wrote: > > Thanks for the response, Collin... here is the verbose output: > > > > C:\rails_apps\test_app>rake db:migrate --trace > > (in C:/rails_apps/test_app) > > ** Invoke db:migrate (first_time) > > ** Invoke environment (first_time) > > ** Execute environment > > ** Execute db:migrate > > rake aborted! > > Bad file descriptor - connect(2) > > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysq > > l.rb:108:in `initialize'' > > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysq > > l.rb:108:in `real_connect'' > > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_ > > adapters/mysql_adapter.rb:330:in `connect'' > > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_ > > adapters/mysql_adapter.rb:87:in `initialize'' > > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_ > > adapters/mysql_adapter.rb:36:in `mysql_connection'' > > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_ > > adapters/abstract/connection_specification.rb:251:in > > `connection_without_query_c > > ache='' > > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/query_cache > > .rb:54:in `connection='' > > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_ > > adapters/abstract/connection_specification.rb:220:in > > `retrieve_connection'' > > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_ > > adapters/abstract/connection_specification.rb:78:in `connection'' > > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.r > > b:282:in `migrate'' > > c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/tasks/databases.rake:4 > > c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute'' > > c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute'' > > c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in `invoke'' > > c:/ruby/lib/ruby/1.8/thread.rb:135:in `synchronize'' > > c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke'' > > c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run'' > > c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run'' > > c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7 > > c:/ruby/bin/rake.bat:25 > > > > Collin Miller wrote: > > > Hmm, you didn''t mention it so I''ll suggest giving > > > > > > rake db:migrate --trace > > > > > > a try to see if the extra verbosity will reap any clues. > > > > > > On 9/16/06, Adam McCrea <adam.mccrea-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > > > > I''m just getting started with Rails, and I''m having trouble getting > > > > everything set up correctly. I have installed Ruby 1.8.4, Rails 1.1.6, > > > > and MySQL 5.0. I am able to create a rails app, start WEBrick, and see > > > > the default page, but I cannot get Rails to play nice with MySQL. I > > > > have not created any migrations, but when I run "rake db:migrate" just > > > > to see if everything is wired up correctly, I get a cryptic error: > > > > > > > > C:\rails_apps\test_app>mysqladmin -u root create test_app_development > > > > C:\rails_apps\test_app>rake db:migrate > > > > (in C:/rails_apps/test_app) > > > > rake aborted! > > > > Bad file descriptor - connect(2) > > > > > > > > My database.yml file contains the defaults: > > > > > > > > development: > > > > adapter: mysql > > > > database: test_app_development > > > > username: root > > > > password: > > > > host: localhost > > > > > > > > And I am able to connect to MySQL through the command line: > > > > > > > > C:\rails_apps\test_app>mysql -u root test_app_development > > > > mysql> create table dummy(i int); > > > > Query OK, 0 rows affected (0.16 sec) > > > > mysql> drop table dummy; > > > > Query OK, 0 rows affected (0.03 sec) > > > > > > > > I should also note that I can use InstantRails without a problem - I''d > > > > just really like to be able to get it working manually. Any thoughts? > > > > > > > > > > > > > > > > > > > > > > > ------=_Part_258621_1352532.1158441734593 > > > Content-Type: text/html; charset=ISO-8859-1 > > > X-Google-AttachSize: 1873 > > > > > > Hmm, you didn''t mention it so I''ll suggest giving<br><br>rake db:migrate --trace<br><br>a try to see if the extra verbosity will reap any clues.<br><br><div><span class="gmail_quote">On 9/16/06, <b class="gmail_sendername"> > > > Adam McCrea</b> <<a href="mailto:adam.mccrea-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org">adam.mccrea-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> > > > <br>I''m just getting started with Rails, and I''m having trouble getting<br>everything set up correctly. I have installed Ruby 1.8.4, Rails 1.1.6,<br>and MySQL 5.0. I am able to create a rails app, start WEBrick, and see > > > <br>the default page, but I cannot get Rails to play nice with MySQL. I<br>have not created any migrations, but when I run "rake db:migrate" just<br>to see if everything is wired up correctly, I get a cryptic error: > > > <br><br>C:\rails_apps\test_app>mysqladmin -u root create test_app_development<br>C:\rails_apps\test_app>rake db:migrate<br>(in C:/rails_apps/test_app)<br>rake aborted!<br>Bad file descriptor - connect(2)<br><br>My database.yml > > > file contains the defaults:<br><br>development:<br> adapter: mysql<br> database: test_app_development<br> username: root<br> password:<br> host: localhost<br><br>And I am able to connect to MySQL through the command line: > > > <br><br>C:\rails_apps\test_app>mysql -u root test_app_development<br>mysql> create table dummy(i int);<br>Query OK, 0 rows affected (0.16 sec)<br>mysql> drop table dummy;<br>Query OK, 0 rows affected (0.03 sec)<br> > > > <br>I should also note that I can use InstantRails without a problem - I''d<br>just really like to be able to get it working manually. Any thoughts?<br><br><br><br><br></blockquote></div><br> > > > > > > ------=_Part_258621_1352532.1158441734593-- > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Adam McCrea wrote:> I tried this with both "localhost" and "127.0.0.1" specified in my > database.yml, and also with and without the port you suggested. From > what I''ve read, it sounds like a lot of people have problems with the > mysql gem on Windows, so I also tried this Mysql/Ruby adapter: > http://www.vandomburg.net/pages/mysql-ruby-windows. Unfortunately, I''m > still getting the "Can''t connect to MySQL server" message with this > adapter.Are you sure that MySQL is set up to actually listen on TCP/IP and not only communicate using sockets? Check your my.cnf for stuff like skip-networking et al. Hope this helps, Roderick -- 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 -~----------~----~----~----~------~----~------~--~---
Roderick, you may be on to something there. My my.ini file (couldn''t find my.cnf) does indeed contain "skip-networking". I disabled remote access intentionally (taking my cue from the Agile Web book) since my root password is blank. I assumed this meant I''d still be able to access the DB locally via TCP/IP. Do you know of any way I could test this? Roderick van Domburg wrote:> Adam McCrea wrote: > > I tried this with both "localhost" and "127.0.0.1" specified in my > > database.yml, and also with and without the port you suggested. From > > what I''ve read, it sounds like a lot of people have problems with the > > mysql gem on Windows, so I also tried this Mysql/Ruby adapter: > > http://www.vandomburg.net/pages/mysql-ruby-windows. Unfortunately, I''m > > still getting the "Can''t connect to MySQL server" message with this > > adapter. > > Are you sure that MySQL is set up to actually listen on TCP/IP and not > only communicate using sockets? > Check your my.cnf for stuff like skip-networking et al. > > Hope this helps, > > Roderick > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Adam McCrea wrote:> Roderick, you may be on to something there. My my.ini file (couldn''t > find my.cnf) does indeed contain "skip-networking". I disabled remote > access intentionally (taking my cue from the Agile Web book) since my > root password is blank. I assumed this meant I''d still be able to > access the DB locally via TCP/IP. Do you know of any way I could test > this?From the top of my head: By commenting out "skip-networking", MySQL will listen to port 3306 on all interfaces by default. Network connections authenticate on a user-to-user, database-to-database basis. You will need to configure a firewall to block port 3306 fully. Perhaps you could configure MySQL to bind to the loopback interface only, but I''d need to read up on that myself. - Roderick -- 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 -~----------~----~----~----~------~----~------~--~---
That worked! Thanks so much for your help. Roderick van Domburg wrote:> Adam McCrea wrote: > > Roderick, you may be on to something there. My my.ini file (couldn''t > > find my.cnf) does indeed contain "skip-networking". I disabled remote > > access intentionally (taking my cue from the Agile Web book) since my > > root password is blank. I assumed this meant I''d still be able to > > access the DB locally via TCP/IP. Do you know of any way I could test > > this? > > From the top of my head: > > By commenting out "skip-networking", MySQL will listen to port 3306 on > all interfaces by default. Network connections authenticate on a > user-to-user, database-to-database basis. You will need to configure a > firewall to block port 3306 fully. > > Perhaps you could configure MySQL to bind to the loopback interface > only, but I''d need to read up on that myself. > > - Roderick > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Adam McCrea wrote:> That worked! Thanks so much for your help.Happy to help. I''ll make sure to update my MySQL/Ruby package and download page to inform users about this little caveat. -- 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 -~----------~----~----~----~------~----~------~--~---