Please, I am just beginning to learn RoR, following the "Up and running" tutorial. setup: ruby and ror=latest; mysql 4.0.17; WEBrick. #Created the app I had to add the -d mysql after looking in the forums, latest RoR does not defaults to mysql rails -d mysql \chapter1 (MySQL) create database chapter1_development; grant all on *.* to ''ODBC@localhost''; ruby script/generate controller Greeting At this point I should see at localhost:3000/greeting something like "an error message telling you that index is an unknown action." (the tutorial says) Instead I see this: ActiveRecord::StatementInvalid in GreetingController#index Mysql::Error: Unknown system variable ''NAMES'': SET NAMES ''utf8'' This is the response I get for EVERY request, even localhost:3000/rails/info/properties. MySQL complains about an unknown system variable, NAMES. I searched the mysql docs, hoping this variable would be present in later versions of MySQL; so upgrading the database would solve the problem. But this variable is nonexistent, in any version of the database. So what''s going on? Thanks to all -- 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 -~----------~----~----~----~------~----~------~--~---
does this help: http://www.sugarcrm.com/forums/archive/index.php/t-14604.html a lot of people seem to have the same problem and a solution is suggested.... ps I just googled for: Mysql::Error: Unknown system variable ''NAMES'': SET NAMES ''utf8'' (not between speech marks and the above was top of the list baby yeah! -- 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 -~----------~----~----~----~------~----~------~--~---
I also faced the same error. Mysql::Error: Unknown system variable ''NAMES'': SET NAMES ''utf8'' I found that in the config\database.yml file there is a line encoding: utf8 I solved this error by removing the line encoding: utf8 from the file config\database.yml file. Do this for development, test, production settings. It worked for me. -Rohit On Jan 25, 11:08 pm, Daniele Mezzetti <rails-mailing-l...@andreas- s.net> wrote:> Please, > I am just beginning to learn RoR, following the "Up and running" > tutorial. > setup: ruby and ror=latest; mysql 4.0.17; WEBrick. > > #Created the app I had to add the -d mysql after looking in the forums, > latest RoR does not defaults to mysql > > rails -d mysql \chapter1 > > (MySQL) > create database chapter1_development; > grant all on *.* to ''ODBC@localhost''; > > ruby script/generate controller Greeting > > At this point I should see at localhost:3000/greeting something like > "an error message telling you that index is an unknown action." (the > tutorial says) > Instead I see this: > > ActiveRecord::StatementInvalid in GreetingController#index > Mysql::Error: Unknown system variable ''NAMES'': SET NAMES ''utf8'' > > This is the response I get for EVERY request, even > localhost:3000/rails/info/properties. > > MySQL complains about an unknown system variable, NAMES. I searched the > mysql docs, hoping this variable would be present in later versions of > MySQL; so upgrading the database would solve the problem. But this > variable is nonexistent, in any version of the database. > > So what''s going on? > > Thanks to all > -- > 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-/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 -~----------~----~----~----~------~----~------~--~---
I have explained the solution in details on my blog http://rohitagarwal24.blogspot.com/ Rohit On Feb 3, 9:23 pm, rohit <rohitagarwa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I also faced the same error. Mysql::Error: Unknown system variable > ''NAMES'': SET NAMES ''utf8'' > I found that in the config\database.yml file there is a line encoding: > utf8 > I solved this error by removing the line encoding: utf8 from the file > config\database.yml file. Do this for development, test, production > settings. > It worked for me. > > -Rohit > > On Jan 25, 11:08 pm, Daniele Mezzetti <rails-mailing-l...@andreas- > > s.net> wrote: > > Please, > > I am just beginning to learn RoR, following the "Up and running" > > tutorial. > > setup: ruby and ror=latest; mysql 4.0.17; WEBrick. > > > #Created the app I had to add the -d mysql after looking in the forums, > > latest RoR does not defaults to mysql > > > rails -d mysql \chapter1 > > > (MySQL) > > create database chapter1_development; > > grant all on *.* to ''ODBC@localhost''; > > > ruby script/generate controller Greeting > > > At this point I should see at localhost:3000/greeting something like > > "an error message telling you that index is an unknown action." (the > > tutorial says) > > Instead I see this: > > > ActiveRecord::StatementInvalid in GreetingController#index > > Mysql::Error: Unknown system variable ''NAMES'': SET NAMES ''utf8'' > > > This is the response I get for EVERY request, even > > localhost:3000/rails/info/properties. > > > MySQL complains about an unknown system variable, NAMES. I searched the > > mysql docs, hoping this variable would be present in later versions of > > MySQL; so upgrading the database would solve the problem. But this > > variable is nonexistent, in any version of the database. > > > So what''s going on? > > > Thanks to all > > -- > > 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-/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 -~----------~----~----~----~------~----~------~--~---