I am running on Linux, attempting the example from the rails movie, http://www.rubyonrails.com/media/video/rails_take2_with_sound.mov Here is the error I''m getting: ActiveRecord::StatementInvalid in Blog#index Packets out of order: 1<>3: SELECT COUNT(*) FROM posts my database config file looks like this: development: adapter: mysql database: blog_development host: localhost username: root password: mysql adapter: mysql socket: /var/lib/mysql/mysql.sock # Warning: The database defined as ''test'' will be erased and # re-generated from your development database when you run ''rake''. # Do not set this db to the same as development or production. test: adapter: mysql database: blog_test host: localhost username: root password: mysql adapter: mysql socket: /var/lib/mysql/mysql.sock production: development my posts table looks like this: +-------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+--------------+------+-----+---------+----------------+ | id | int(11) | | PRI | NULL | auto_increment | | title | varchar(225) | YES | | NULL | | +-------+--------------+------+-----+---------+----------------+ Any Ideas? -Will
I have a similar problem and I solve it with a native version of mysql. Try with gem install mysql El Miércoles, 7 de Septiembre de 2005 19:48, Will escribió:> I am running on Linux, attempting the example from the rails movie, > http://www.rubyonrails.com/media/video/rails_take2_with_sound.mov > > Here is the error I''m getting: > ActiveRecord::StatementInvalid in Blog#index > Packets out of order: 1<>3: SELECT COUNT(*) FROM posts > > > my database config file looks like this: > > development: > adapter: mysql > database: blog_development > host: localhost > username: root > password: mysql > adapter: mysql > socket: /var/lib/mysql/mysql.sock > > # Warning: The database defined as ''test'' will be erased and > # re-generated from your development database when you run ''rake''. > # Do not set this db to the same as development or production. > test: > adapter: mysql > database: blog_test > host: localhost > username: root > password: mysql > adapter: mysql > socket: /var/lib/mysql/mysql.sock > > production: > development > > > my posts table looks like this: > +-------+--------------+------+-----+---------+----------------+ > > | Field | Type | Null | Key | Default | Extra | > > +-------+--------------+------+-----+---------+----------------+ > > | id | int(11) | | PRI | NULL | auto_increment | > | title | varchar(225) | YES | | NULL | | > > +-------+--------------+------+-----+---------+----------------+ > > Any Ideas? > > -Will > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Jesús Sánchez Cuadrado wrote:> I have a similar problem and I solve it with a native version of mysql. Try > with > gem install mysql > > > El Miércoles, 7 de Septiembre de 2005 19:48, Will escribió: > >>I am running on Linux, attempting the example from the rails movie, >>http://www.rubyonrails.com/media/video/rails_take2_with_sound.mov >> >>Here is the error I''m getting: >>ActiveRecord::StatementInvalid in Blog#index >>Packets out of order: 1<>3: SELECT COUNT(*) FROM posts >> >> >>my database config file looks like this: >> >>development: >> adapter: mysql >> database: blog_development >> host: localhost >> username: root >> password: mysql >> adapter: mysql >> socket: /var/lib/mysql/mysql.sock >> >># Warning: The database defined as ''test'' will be erased and >># re-generated from your development database when you run ''rake''. >># Do not set this db to the same as development or production. >>test: >> adapter: mysql >> database: blog_test >> host: localhost >> username: root >> password: mysql >> adapter: mysql >> socket: /var/lib/mysql/mysql.sock >> >>production: >> development >> >> >>my posts table looks like this: >>+-------+--------------+------+-----+---------+----------------+ >> >>| Field | Type | Null | Key | Default | Extra | >> >>+-------+--------------+------+-----+---------+----------------+ >> >>| id | int(11) | | PRI | NULL | auto_increment | >>| title | varchar(225) | YES | | NULL | | >> >>+-------+--------------+------+-----+---------+----------------+ >> >>Any Ideas? >> >>-Will >> >>_______________________________________________ >>Rails mailing list >>Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>http://lists.rubyonrails.org/mailman/listinfo/railsI tried that and this is what I get: [root@localhost will]# gem install mysql Attempting local installation of ''mysql'' Local gem file not found: mysql*.gem Attempting remote installation of ''mysql'' Updating Gem source index for: http://gems.rubyforge.org Building native extensions. This could take a while... ERROR: While executing gem ... (RuntimeError) ERROR: Failed to build gem native extension. Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/mysql-2.6 for inspection. ruby extconf.rb install mysql\nchecking for mysql_query() in -lmysqlclient... no checking for main() in -lm... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lz... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lsocket... no checking for mysql_query() in -lmysqlclient... no checking for main() in -lnsl... yes checking for mysql_query() in -lmysqlclient... no Results logged to /usr/local/lib/ruby/gems/1.8/gems/mysql-2.6/gem_make.out Any ideas?
I think you have to install the mysql-devel packages. They are needed for the mysql gem to compile. I think that was what I had to do... Ronny On 9/7/05, Will <willis3140@hotmail.com> wrote:> > Jesús Sánchez Cuadrado wrote: > > I have a similar problem and I solve it with a native version of mysql. > Try > > with > > gem install mysql > > > > > > El Miércoles, 7 de Septiembre de 2005 19:48, Will escribió: > > > >>I am running on Linux, attempting the example from the rails movie, > >>http://www.rubyonrails.com/media/video/rails_take2_with_sound.mov > >> > >>Here is the error I'm getting: > >>ActiveRecord::StatementInvalid in Blog#index > >>Packets out of order: 1<>3: SELECT COUNT(*) FROM posts > >> > >> > >>my database config file looks like this: > >> > >>development: > >> adapter: mysql > >> database: blog_development > >> host: localhost > >> username: root > >> password: mysql > >> adapter: mysql > >> socket: /var/lib/mysql/mysql.sock > >> > >># Warning: The database defined as 'test' will be erased and > >># re-generated from your development database when you run 'rake'. > >># Do not set this db to the same as development or production. > >>test: > >> adapter: mysql > >> database: blog_test > >> host: localhost > >> username: root > >> password: mysql > >> adapter: mysql > >> socket: /var/lib/mysql/mysql.sock > >> > >>production: > >> development > >> > >> > >>my posts table looks like this: > >>+-------+--------------+------+-----+---------+----------------+ > >> > >>| Field | Type | Null | Key | Default | Extra | > >> > >>+-------+--------------+------+-----+---------+----------------+ > >> > >>| id | int(11) | | PRI | NULL | auto_increment | > >>| title | varchar(225) | YES | | NULL | | > >> > >>+-------+--------------+------+-----+---------+----------------+ > >> > >>Any Ideas? > >> > >>-Will > >> > >>_______________________________________________ > >>Rails mailing list > >>Rails@lists.rubyonrails.org > >>http://lists.rubyonrails.org/mailman/listinfo/rails > > > I tried that and this is what I get: > > [root@localhost will]# gem install mysql > Attempting local installation of 'mysql' > Local gem file not found: mysql*.gem > Attempting remote installation of 'mysql' > Updating Gem source index for: http://gems.rubyforge.org > Building native extensions. This could take a while... > ERROR: While executing gem ... (RuntimeError) > ERROR: Failed to build gem native extension. > Gem files will remain installed in > /usr/local/lib/ruby/gems/1.8/gems/mysql-2.6 for inspection. > ruby extconf.rb install mysql\nchecking for mysql_query() in > -lmysqlclient... no > checking for main() in -lm... yes > checking for mysql_query() in -lmysqlclient... no > checking for main() in -lz... yes > checking for mysql_query() in -lmysqlclient... no > checking for main() in -lsocket... no > checking for mysql_query() in -lmysqlclient... no > checking for main() in -lnsl... yes > checking for mysql_query() in -lmysqlclient... no > > > Results logged to /usr/local/lib/ruby/gems/1.8/gems/mysql-2.6/gem_make.out > > > Any ideas? > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 9/7/05, Jesús Sánchez Cuadrado <lsanch15-0p8r/1pxuPij7+oExtyfFDEAbCKwanjM@public.gmane.org> wrote:> I have a similar problem and I solve it with a native version of mysql. Try > with > gem install mysql >Depending on your distro, there may be a package for the mysql ruby bindings, that might also work. eg, Debian has libmysql-ruby -- Chris Martin Web Developer Open Source & Web Standards Advocate http://www.chriscodes.com/