I''ve created a new application from scratch on a new development machine. I''ve installed Ruby, Rails and MySQL using as many defaults as possible. I''m receiving the following error> Mysql::Error: query: not connected: INSERT INTO `posts`when I try to add a new post to my database. My database.yml development settings looks like> development:database: blog_development adapter: mysql host: 127.0.0.1 username: root password: socket: /tmp/mysql.sock What am I doing wrong? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Am 21.01.2010 um 11:35 schrieb Pale Horse:> I''ve created a new application from scratch on a new development > machine. I''ve installed Ruby, Rails and MySQL using as many defaults as > possible. > > I''m receiving the following error > >> Mysql::Error: query: not connected: INSERT INTO `posts` > > when I try to add a new post to my database. > > My database.yml development settings looks like > >> development: > database: blog_development > adapter: mysql > host: 127.0.0.1 > username: root > password: > socket: /tmp/mysql.sock > > What am I doing wrong?Two things that come to mind: 1. Did the migration creating the posts in the db run through correctly? 2. Did you start your "rails server" (be it script/server, passenger or whatever) in development mode? Felix -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Felix Schäfer wrote:> Am 21.01.2010 um 11:35 schrieb Pale Horse: > >> My database.yml development settings looks like >> >>> development: >> database: blog_development >> adapter: mysql >> host: 127.0.0.1 >> username: root >> password: >> socket: /tmp/mysql.sock >> >> What am I doing wrong? > > Two things that come to mind: > 1. Did the migration creating the posts in the db run through correctly? > 2. Did you start your "rails server" (be it script/server, passenger or > whatever) in development mode? > > FelixIn response to 1. The migration ran fine. I thought I''d repaired a similar error when I previously tried to run the migration by changing the client library in /bin. Could this be the problem? In response to 2. I initiated the server with ruby script/server command. I would presume it''s running in development mode as the application is reloaded on page refresh. Any thoughts? -- Posted via http://www.ruby-forum.com/. --0003255574aab159df047daa68e4 Content-Type: text/plain; charset=ISO-8859-1 -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. --0003255574aab159df047daa68e4--
Hello Pale, You need to install gem for mysql. gem install mysql also if you are running your app at local machine then use ''localhost'' as host. try to make make your development config like development: adapter: mysql encoding: utf8 reconnect: false database: test_development pool: 5 username: root password: root host: localhost Thanks & Regards Ankit Varshney On Thu, Jan 21, 2010 at 4:05 PM, Pale Horse <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I''ve created a new application from scratch on a new development > machine. I''ve installed Ruby, Rails and MySQL using as many defaults as > possible. > > I''m receiving the following error > > > Mysql::Error: query: not connected: INSERT INTO `posts` > > when I try to add a new post to my database. > > My database.yml development settings looks like > > > development: > database: blog_development > adapter: mysql > host: 127.0.0.1 > username: root > password: > socket: /tmp/mysql.sock > > What am I doing wrong? > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ankit Varshney wrote:> Hello Pale, > > You need to install gem for mysql. > > gem install mysql > > also if you are running your app at local machine then use ''localhost'' > as > host. > > try to make make your development config like > > development: > adapter: mysql > encoding: utf8 > reconnect: false > database: test_development > pool: 5 > username: root > password: root > host: localhost > > Thanks & Regards > Ankit VarshneyThank you for your response. I''ve already installed the MySQL gem so that''s not the issue. localhost or the address I specified are both fine to use as the host. I even went as far back as to ensure a database existed (despite my migration running without a problem). To solve the issue, I replaced the client library and restarted my server. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.