I have been working on a Rails implementation of the JPetstore. It''s goal is to exercise all the capabilities of Rails and (hopefully, to some degree) be a reference application that illustrates best practices for developing web applications. Currently, it is very much a straight port of JPetstore with with minor modifications the the database and images. It makes use of all the major components of of Rails, and will soon be modified to use AJAX and Action Web Services. http://www.anassina.com/projects/railspetstore/ Thanks! Aaron
What a fantastic idea, nice work Aaron. -PJ On 7/24/05, Aaron Rustad <arustad-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have been working on a Rails implementation of the JPetstore. It''s > goal is to exercise all the capabilities of Rails and (hopefully, to > some degree) be a reference application that illustrates best > practices for developing web applications. > > Currently, it is very much a straight port of JPetstore with with > minor modifications the the database and images. It makes use of all > the major components of of Rails, and will soon be modified to use > AJAX and Action Web Services. > > http://www.anassina.com/projects/railspetstore/ > > Thanks! > Aaron > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Aaron Rustad wrote:> I have been working on a Rails implementation of the JPetstore. It''s > goal is to exercise all the capabilities of Rails and (hopefully, to > some degree) be a reference application that illustrates best > practices for developing web applications. > > Currently, it is very much a straight port of JPetstore with with > minor modifications the the database and images. It makes use of all > the major components of of Rails, and will soon be modified to use > AJAX and Action Web Services. > > http://www.anassina.com/projects/railspetstore/Aaron, This looks great - I''m looking for some sort of complete app. to study and understand rails more. I''ve grabbed the zip and given it a try and have the following suggestions/issues: 1. Aaron is obviously using Windows - you need to change the #! path to match the actual location of your ruby executable. Eg. on my Linux system: #!/usr/bin/ruby. I''ve changed this in: dispatch.fcgi dispatch.rb All files in the scripts dir 2. I suggest you remove the "Use rpetstore" lines from the SQL - others may want to use a DB with a different name. 3. I''m having trouble getting this working. When I try and run it under fasgcgi, I get the front page when I open the root of the site but when I click "Enter store" I get no response at all, and nothing in any logs. When I run it under webrick, I get a little further in that I can enter the store successfully, but when I click on a category, e.g. "FISH" I get the follow MySQL error: No such file or directory - /tmp/mysql.sock MySQL is using /var/lib/mysql/mysql.sock on my system - I''m not sure why it''s trying to use /tmp/mysql.sock. Is there a better place to discuss this, or is the Rails list appropriate? -- http://robinbowes.com If a man speaks in a forest, and his wife''s not there, is he still wrong?
Robin Bowes wrote:> > 3. I''m having trouble getting this working. When I try and run it under > fasgcgi, I get the front page when I open the root of the site but when > I click "Enter store" I get no response at all, and nothing in any logs. > When I run it under webrick, I get a little further in that I can enter > the store successfully, but when I click on a category, e.g. "FISH" I > get the follow MySQL error: > > No such file or directory - /tmp/mysql.sock > > MySQL is using /var/lib/mysql/mysql.sock on my system - I''m not sure why > it''s trying to use /tmp/mysql.sock.Ok, I''ve got a little further in that I''ve got this working with fastcgi by using dispatch.fcgi from my typo app instead of the one that comes with the petstore app. I''m still getting the /tmp/mysql.sock error, but that is a fairly well-defined problem - I just need to figure out how to tell Rails to use a different socket. Any suggestions? R. -- http://robinbowes.com If a man speaks in a forest, and his wife''s not there, is he still wrong?
Robin Bowes wrote:> No such file or directory - /tmp/mysql.sock > > MySQL is using /var/lib/mysql/mysql.sock on my system - I''m not sure why > it''s trying to use /tmp/mysql.sock.OK, I googled for "rails mysql.sock" and the first result is this: http://dev.rubyonrails.com/ticket/200 The suggested fix worked (put socket: /var/lib/mysql/mysql.sock in database.yml). Now I''m running into the following error: ActiveRecord::StatementInvalid (''Packets out of order'' error was received from t he database. Please update your mysql bindings (gem update mysql) and read http: //dev.mysql.com/doc/mysql/en/password-hashing.html for more information.): I tried updating mysql, but got errors: Attempting remote upgrade of mysql Attempting remote installation of ''mysql'' Building native extensions. This could take a while... mysql.c: In function ‘make_field_obj’: mysql.c:106: warning: unused variable ‘hash’ mysql.c: In function ‘query’: mysql.c:635: error: invalid storage class for function ‘res_free’ mysql.c:637: error: ‘res_free’ undeclared (first use in this function) mysql.c:637: error: (Each undeclared identifier is reported only once mysql.c:637: error: for each function it appears in.) make: *** [mysql.o] Error 1 mysql.c: In function ‘make_field_obj’: mysql.c:106: warning: unused variable ‘hash’ mysql.c: In function ‘query’: mysql.c:635: error: invalid storage class for function ‘res_free’ mysql.c:637: error: ‘res_free’ undeclared (first use in this function) mysql.c:637: error: (Each undeclared identifier is reported only once mysql.c:637: error: for each function it appears in.) make: *** [mysql.o] Error 1 ruby extconf.rb update mysql checking for mysql_query() in -lmysqlclient... yes checking for mysql_ssl_set()... yes checking for mysql.h... no checking for mysql/mysql.h... yes creating Makefile make i386-redhat-linux-gcc -fPIC -O0 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -m32 -march=i386 -mtune=pentium4 -fasynchronous-unwind-tables -Wall -fPIC -I. -I/usr/lib/ruby/1.8/i386-linux -I/usr/lib/ruby/1.8/i386-linux -I. -DHAVE_MYSQL_SSL_SET -DHAVE_MYSQL_MYSQL_H -I/usr/local/include -c mysql.c make install i386-redhat-linux-gcc -fPIC -O0 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -m32 -march=i386 -mtune=pentium4 -fasynchronous-unwind-tables -Wall -fPIC -I. -I/usr/lib/ruby/1.8/i386-linux -I/usr/lib/ruby/1.8/i386-linux -I. -DHAVE_MYSQL_SSL_SET -DHAVE_MYSQL_MYSQL_H -I/usr/local/include -c mysql.c Successfully installed mysql-2.6 Gems: [mysql] updated Notice it claims to have installed successfully. I searched for this too and found the following article; http://weblog.rubyonrails.com/archives/2005/07/11/compiling-the-mysql-c-bindings-under-tiger Now, I''m not using OS X !0.4 "Tiger" but I am using Fedora Core 4 which also ships with gcc 4.0, so I am guessing that the above errors are because of this. Unfortunately, I don''t seem to have gcc-select so I can''t try the fix suggested at the above url. Any ideas how to get round this? R. -- http://robinbowes.com If a man speaks in a forest, and his wife''s not there, is he still wrong?
Robin Bowes wrote:> > Now I''m running into the following error: > > ActiveRecord::StatementInvalid (''Packets out of order'' error was > received from t > he database. Please update your mysql bindings (gem update mysql) and > read http: > //dev.mysql.com/doc/mysql/en/password-hashing.html for more information.):OK - drastic solution: use postgresql instead! The only modification required in the DB schema was to alter one line from "int not null AUTO_INCREMENT" to "serial not null". I created the database, created the schema, loaded the data, modified database.yml to work with postgres instead of mysql and restarted apache and bingo! It''s up and running here: http://rpetstore.robinbowes.com R. -- http://robinbowes.com If a man speaks in a forest, and his wife''s not there, is he still wrong?
Change your database.yml to look like this: development: adapter: mysql database: <db> host: localhost socket: /var/lib/mysql/mysql.sock username: <user> password: <password> At least that worked for me on RHEL 3 - Michael On 7/29/05, Robin Bowes <robin-lists-uu/5VZhsSz10ubjbjo6WXg@public.gmane.org> wrote:> Robin Bowes wrote: > > > > 3. I''m having trouble getting this working. When I try and run it under > > fasgcgi, I get the front page when I open the root of the site but when > > I click "Enter store" I get no response at all, and nothing in any logs. > > When I run it under webrick, I get a little further in that I can enter > > the store successfully, but when I click on a category, e.g. "FISH" I > > get the follow MySQL error: > > > > No such file or directory - /tmp/mysql.sock > > > > MySQL is using /var/lib/mysql/mysql.sock on my system - I''m not sure why > > it''s trying to use /tmp/mysql.sock. > > Ok, I''ve got a little further in that I''ve got this working with fastcgi > by using dispatch.fcgi from my typo app instead of the one that comes > with the petstore app. > > I''m still getting the /tmp/mysql.sock error, but that is a fairly > well-defined problem - I just need to figure out how to tell Rails to > use a different socket. > > Any suggestions? > > R. > > -- > http://robinbowes.com > > If a man speaks in a forest, > and his wife''s not there, > is he still wrong? > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Robin,> Unfortunately, I don''t seem to have gcc-select so I can''t try the fix > suggested at the above url. > > Any ideas how to get round this?\Try this patch to mysql.c: http://www.ibd.com/dl/mysql.patch.txt Regards, Sean _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Sean Mountcastle wrote:> Robin, > > > Unfortunately, I don''t seem to have gcc-select so I can''t try the fix > > suggested at the above url. > > > > Any ideas how to get round this?\ > > Try this patch to mysql.c: http://www.ibd.com/dl/mysql.patch.txt >Sean, Thanks. I''ll give it a go if I get chance, although to be honest, I prefer working with pgsql. Thanks again, R. -- http://robinbowes.com If a man speaks in a forest, and his wife''s not there, is he still wrong?
Hi: I am a rails newbie and I''m trying to install the rails petstore application to understand how a full fledged app works. I''ve created the database in mysql as rpetstore using the included mysql files. I''ve also run the Webrick server and I can access the pretty catalog/ main page with the parrot. However, from there I run into problems. Everytime I click on one of the animal choices (dogs, cats, etc.) I get the following error message: ActiveRecord::StatementInvalid in Catalog#view_category No database selected: SELECT * FROM category WHERE category.catid = ''REPTILES'' LIMIT 1 app/controllers/catalog_controller.rb:3:in `view_category'' script/server:48 Show framework trace Request Parameters: {"id"=>"REPTILES"} Show session dump Response Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} What does this mean? Apologies for the basic question but I hope someone can quickly point me in the right direction. BTW, I''m running this on a Mac OS X Tiger 10.4.2 Thanks, Rasheq Rahman rasheq.rahman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
> ActiveRecord::StatementInvalid in Catalog#view_category > > No database selected: SELECT * FROM category WHERE category.catid = > ''REPTILES'' LIMIT 1 > app/controllers/catalog_controller.rb:3:in `view_category'' > script/server:48 > Show framework traceHmmm, is database.yml ok, with the database name filled in etc? - Marten
Rasheq, I can only reproduce this error if I remove the database entry in config/database.yml. Make sure it looks something like this: development: adapter: mysql database: rpetstore_dev host: localhost username: password: AR. On 7/29/05, Rasheq Rahman <rasheq.rahman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hi: > > I am a rails newbie and I''m trying to install the rails petstore application > to understand how a full fledged app works. I''ve created the database in > mysql as rpetstore using the included mysql files. I''ve also run the Webrick > server and I can access the pretty catalog/main page with the parrot. > However, from there I run into problems. Everytime I click on one of the > animal choices (dogs, cats, etc.) I get the following error message: > > > > > ActiveRecord::StatementInvalid in Catalog#view_category > No database selected: SELECT * FROM category WHERE category.catid > ''REPTILES'' LIMIT 1 > app/controllers/catalog_controller.rb:3:in `view_category'' > script/server:48 > Show framework trace > > > > > Request > > Parameters: {"id"=>"REPTILES"} > > Show session dump > > Response > Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} > > What does this mean? > > Apologies for the basic question but I hope someone can quickly point me in > the right direction. > > BTW, I''m running this on a Mac OS X Tiger 10.4.2 > > Thanks, > > Rasheq Rahman > rasheq.rahman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
Sorry to all for the blinding font in my first post. I had just copied the error message from Safari. I made the changes Aaron suggested and I''m still getting the same error. My database.yml file looks like this (I have removed the username/ password per Aaron''s example below): development: adapter: mysql database: rpetstore host: localhost username: password: test: adapter: mysql database: rpetstore host: localhost username: password: production: adapter: mysql database: rpetstore host: localhost username: password: Does the dev database have to be called rpetstore_dev? Also, I created the database in CocoaMySQL. Does anyone know if that grants all permissions to the login user (in my case root)? Thanks, Rasheq On Jul 30, 2005, at 2:01 AM, Aaron Rustad wrote:> Rasheq, I can only reproduce this error if I remove the database entry > in config/database.yml. Make sure it looks something like this: > > development: > adapter: mysql > database: rpetstore_dev > host: localhost > username: > password: > > AR. > > On 7/29/05, Rasheq Rahman <rasheq.rahman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> >> >> Hi: >> >> I am a rails newbie and I''m trying to install the rails petstore >> application >> to understand how a full fledged app works. I''ve created the >> database in >> mysql as rpetstore using the included mysql files. I''ve also run >> the Webrick >> server and I can access the pretty catalog/main page with the parrot. >> However, from there I run into problems. Everytime I click on one >> of the >> animal choices (dogs, cats, etc.) I get the following error message: >> >> >> >> >> ActiveRecord::StatementInvalid in Catalog#view_category >> No database selected: SELECT * FROM category WHERE category.catid >> ''REPTILES'' LIMIT 1 >> app/controllers/catalog_controller.rb:3:in `view_category'' >> script/server:48 >> Show framework trace >> >> >> >> >> Request >> >> Parameters: {"id"=>"REPTILES"} >> >> Show session dump >> >> Response >> Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} >> >> What does this mean? >> >> Apologies for the basic question but I hope someone can quickly >> point me in >> the right direction. >> >> BTW, I''m running this on a Mac OS X Tiger 10.4.2 >> >> Thanks, >> >> Rasheq Rahman >> rasheq.rahman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> >> >> > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Root doesn''t need permissions granted. It''s quite dangerous to use your root user for anything in an app, by the way. :) On Jul 30, 2005, at 7:55 AM, Rasheq Rahman wrote:> Sorry to all for the blinding font in my first post. I had just > copied the error message from Safari. > > I made the changes Aaron suggested and I''m still getting the same > error. > > My database.yml file looks like this (I have removed the username/ > password per Aaron''s example below): > > development: > adapter: mysql > database: rpetstore > host: localhost > username: > password: > > test: > adapter: mysql > database: rpetstore > host: localhost > username: > password: > > production: > adapter: mysql > database: rpetstore > host: localhost > username: > password: > > Does the dev database have to be called rpetstore_dev? > > Also, I created the database in CocoaMySQL. Does anyone know if > that grants all permissions to the login user (in my case root)? > > Thanks, > > Rasheq > > On Jul 30, 2005, at 2:01 AM, Aaron Rustad wrote: > > >> Rasheq, I can only reproduce this error if I remove the database >> entry >> in config/database.yml. Make sure it looks something like this: >> >> development: >> adapter: mysql >> database: rpetstore_dev >> host: localhost >> username: >> password: >> >> AR. >> >> On 7/29/05, Rasheq Rahman <rasheq.rahman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> >>> >>> >>> Hi: >>> >>> I am a rails newbie and I''m trying to install the rails petstore >>> application >>> to understand how a full fledged app works. I''ve created the >>> database in >>> mysql as rpetstore using the included mysql files. I''ve also run >>> the Webrick >>> server and I can access the pretty catalog/main page with the >>> parrot. >>> However, from there I run into problems. Everytime I click on one >>> of the >>> animal choices (dogs, cats, etc.) I get the following error message: >>> >>> >>> >>> >>> ActiveRecord::StatementInvalid in Catalog#view_category >>> No database selected: SELECT * FROM category WHERE category.catid >>> ''REPTILES'' LIMIT 1 >>> app/controllers/catalog_controller.rb:3:in `view_category'' >>> script/server:48 >>> Show framework trace >>> >>> >>> >>> >>> Request >>> >>> Parameters: {"id"=>"REPTILES"} >>> >>> Show session dump >>> >>> Response >>> Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} >>> >>> What does this mean? >>> >>> Apologies for the basic question but I hope someone can quickly >>> point me in >>> the right direction. >>> >>> BTW, I''m running this on a Mac OS X Tiger 10.4.2 >>> >>> Thanks, >>> >>> Rasheq Rahman >>> rasheq.rahman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org >>> _______________________________________________ >>> Rails mailing list >>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >>> >>> >>> >>> >>> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
All: On a hunch I decided to upgrade my rails version to 0.13.1 and re-loaded the rpetstore app. Everything worked fine. I think there was a problem with my ActiveRecord setup. Thanks for your help, Rasheq On 7/30/05, Aaron Rustad <arustad-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Yes, if you look at the database_schema script, it is called > rpetstore_dev. Generally, when developing Rails apps, you will want to > use 3 different DBs....one for dev, test, and production. > > > > On 7/30/05, Rasheq Rahman <rasheq.rahman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Sorry to all for the blinding font in my first post. I had just > > copied the error message from Safari. > > > > I made the changes Aaron suggested and I''m still getting the same error. > > > > My database.yml file looks like this (I have removed the username/ > > password per Aaron''s example below): > > > > development: > > adapter: mysql > > database: rpetstore > > host: localhost > > username: > > password: > > > > test: > > adapter: mysql > > database: rpetstore > > host: localhost > > username: > > password: > > > > production: > > adapter: mysql > > database: rpetstore > > host: localhost > > username: > > password: > > > > Does the dev database have to be called rpetstore_dev? > > > > Also, I created the database in CocoaMySQL. Does anyone know if that > > grants all permissions to the login user (in my case root)? > > > > Thanks, > > > > Rasheq > > > > On Jul 30, 2005, at 2:01 AM, Aaron Rustad wrote: > > > > > Rasheq, I can only reproduce this error if I remove the database entry > > > in config/database.yml. Make sure it looks something like this: > > > > > > development: > > > adapter: mysql > > > database: rpetstore_dev > > > host: localhost > > > username: > > > password: > > > > > > AR. > > > > > > On 7/29/05, Rasheq Rahman <rasheq.rahman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > >> > > >> > > >> Hi: > > >> > > >> I am a rails newbie and I''m trying to install the rails petstore > > >> application > > >> to understand how a full fledged app works. I''ve created the > > >> database in > > >> mysql as rpetstore using the included mysql files. I''ve also run > > >> the Webrick > > >> server and I can access the pretty catalog/main page with the parrot. > > >> However, from there I run into problems. Everytime I click on one > > >> of the > > >> animal choices (dogs, cats, etc.) I get the following error message: > > >> > > >> > > >> > > >> > > >> ActiveRecord::StatementInvalid in Catalog#view_category > > >> No database selected: SELECT * FROM category WHERE category.catid > > >> ''REPTILES'' LIMIT 1 > > >> app/controllers/catalog_controller.rb:3:in `view_category'' > > >> script/server:48 > > >> Show framework trace > > >> > > >> > > >> > > >> > > >> Request > > >> > > >> Parameters: {"id"=>"REPTILES"} > > >> > > >> Show session dump > > >> > > >> Response > > >> Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} > > >> > > >> What does this mean? > > >> > > >> Apologies for the basic question but I hope someone can quickly > > >> point me in > > >> the right direction. > > >> > > >> BTW, I''m running this on a Mac OS X Tiger 10.4.2 > > >> > > >> Thanks, > > >> > > >> Rasheq Rahman > > >> rasheq.rahman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > >> _______________________________________________ > > >> Rails mailing list > > >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > >> http://lists.rubyonrails.org/mailman/listinfo/rails > > >> > > >> > > >> > > >> > > > _______________________________________________ > > > Rails mailing list > > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > >
You need a different name for at least your test database. If you name the test db the same as you other db''s then the tests will clobber you dev and production db''s. Adding _dev, _production and _test after the rpetstore name for your db''s is a smart thing to do. You don''t need to even have an actual db made for anything other than your rpetstore_dev database. The other two are cloned and created from your dev db when you switch to production mode. And your test db get''s set up and erased every time you run your rake tests. This means that pointing all 3 db''s at the same db is dangerous. HTH- -Ezra On Jul 30, 2005, at 9:07 AM, Rasheq Rahman wrote:> All: > > On a hunch I decided to upgrade my rails version to 0.13.1 and > re-loaded the rpetstore app. Everything worked fine. > > I think there was a problem with my ActiveRecord setup. > > Thanks for your help, > > Rasheq > > On 7/30/05, Aaron Rustad <arustad-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Yes, if you look at the database_schema script, it is called >> rpetstore_dev. Generally, when developing Rails apps, you will >> want to >> use 3 different DBs....one for dev, test, and production. >> >> >> >> On 7/30/05, Rasheq Rahman <rasheq.rahman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> Sorry to all for the blinding font in my first post. I had just >>> copied the error message from Safari. >>> >>> I made the changes Aaron suggested and I''m still getting the same >>> error. >>> >>> My database.yml file looks like this (I have removed the username/ >>> password per Aaron''s example below): >>> >>> development: >>> adapter: mysql >>> database: rpetstore >>> host: localhost >>> username: >>> password: >>> >>> test: >>> adapter: mysql >>> database: rpetstore >>> host: localhost >>> username: >>> password: >>> >>> production: >>> adapter: mysql >>> database: rpetstore >>> host: localhost >>> username: >>> password: >>> >>> Does the dev database have to be called rpetstore_dev? >>> >>> Also, I created the database in CocoaMySQL. Does anyone know if that >>> grants all permissions to the login user (in my case root)? >>> >>> Thanks, >>> >>> Rasheq >>> >>> On Jul 30, 2005, at 2:01 AM, Aaron Rustad wrote: >>> >>> >>>> Rasheq, I can only reproduce this error if I remove the database >>>> entry >>>> in config/database.yml. Make sure it looks something like this: >>>> >>>> development: >>>> adapter: mysql >>>> database: rpetstore_dev >>>> host: localhost >>>> username: >>>> password: >>>> >>>> AR. >>>> >>>> On 7/29/05, Rasheq Rahman <rasheq.rahman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>> >>>> >>>>> >>>>> >>>>> Hi: >>>>> >>>>> I am a rails newbie and I''m trying to install the rails petstore >>>>> application >>>>> to understand how a full fledged app works. I''ve created the >>>>> database in >>>>> mysql as rpetstore using the included mysql files. I''ve also run >>>>> the Webrick >>>>> server and I can access the pretty catalog/main page with the >>>>> parrot. >>>>> However, from there I run into problems. Everytime I click on one >>>>> of the >>>>> animal choices (dogs, cats, etc.) I get the following error >>>>> message: >>>>> >>>>> >>>>> >>>>> >>>>> ActiveRecord::StatementInvalid in Catalog#view_category >>>>> No database selected: SELECT * FROM category WHERE >>>>> category.catid >>>>> ''REPTILES'' LIMIT 1 >>>>> app/controllers/catalog_controller.rb:3:in `view_category'' >>>>> script/server:48 >>>>> Show framework trace >>>>> >>>>> >>>>> >>>>> >>>>> Request >>>>> >>>>> Parameters: {"id"=>"REPTILES"} >>>>> >>>>> Show session dump >>>>> >>>>> Response >>>>> Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} >>>>> >>>>> What does this mean? >>>>> >>>>> Apologies for the basic question but I hope someone can quickly >>>>> point me in >>>>> the right direction. >>>>> >>>>> BTW, I''m running this on a Mac OS X Tiger 10.4.2 >>>>> >>>>> Thanks, >>>>> >>>>> Rasheq Rahman >>>>> rasheq.rahman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org >>>>> _______________________________________________ >>>>> Rails mailing list >>>>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>>> http://lists.rubyonrails.org/mailman/listinfo/rails >>>>> >>>>> >>>>> >>>>> >>>>> >>>> _______________________________________________ >>>> Rails mailing list >>>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>>> http://lists.rubyonrails.org/mailman/listinfo/rails >>>> >>>> >>> >>> >>> >> >> > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-Ezra Zygmuntowicz WebMaster Yakima Herald-Republic Newspaper ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org 509-577-7732