I installed InstantRails (current config here: http://instantrails.rubyforge.org/wiki/wiki.pl?Release_Notes), and tried the depot example from the pragmatic Rails book. I got to generating the scaffold on page 57, and got the following response: C:\InstantRails\rails_apps\depot>ruby script/generate scaffold Product Admin dependency model exists app/models/ exists test/unit/ exists test/fixtures/ create app/models/product.rb create test/unit/product_test.rb create test/fixtures/products.yml exists app/controllers/ exists app/helpers/ create app/views/admin exists test/functional/ create app/controllers/admin_controller.rb create test/functional/admin_controller_test.rb create app/helpers/admin_helper.rb create app/views/layouts/admin.rhtml create public/stylesheets/scaffold.css create app/views/admin/list.rhtml create app/views/admin/show.rhtml create app/views/admin/new.rhtml create app/views/admin/edit.rhtml error Before updating scaffolding from new DB schema, try creating a table for your model (Product) I did a bit of looking around on the web, and it seems there are others who have the same problem I have. And oh, btw, I tried this on two different WinXP Prof boxes, both gave the same results. I even tried the suggestion one blogger and did a "gem update", but that just seemed to make matters worse. I got hooked on Dave Thomas'' talks at the recent Calgary NFJS, and would REALLY like to take RoR for a spin, but this problem has me stumped! Any ideas ? --Hendie Dijkman _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 10/25/05, Hendie Dijkman <ruby-Vki3jUAxBCcyzzc7d281tmfPcZCv/ETZ@public.gmane.org> wrote:> > I installed InstantRails (current config here: > http://instantrails.rubyforge.org/wiki/wiki.pl?Release_Notes), and tried > the depot example from the pragmatic Rails book. I got to generating the > scaffold on page 57, and got the following response: > > C:\InstantRails\rails_apps\depot>ruby script/generate scaffold Product > Admin > dependency model > exists app/models/ > exists test/unit/ > exists test/fixtures/ > create app/models/product.rb > create test/unit/product_test.rb > create test/fixtures/products.yml > exists app/controllers/ > exists app/helpers/ > create app/views/admin > exists test/functional/ > create app/controllers/admin_controller.rb > create test/functional/admin_controller_test.rb > create app/helpers/admin_helper.rb > create app/views/layouts/admin.rhtml > create public/stylesheets/scaffold.css > create app/views/admin/list.rhtml > create app/views/admin/show.rhtml > create app/views/admin/new.rhtml > create app/views/admin/edit.rhtml > error Before updating scaffolding from new DB schema, try creating a table > for your model (Product) > > I did a bit of looking around on the web, and it seems there are others > who have the same problem I have. And oh, btw, I tried this on two different > WinXP Prof boxes, both gave the same results. I even tried the suggestion > one blogger and did a "gem update", but that just seemed to make matters > worse. > > I got hooked on Dave Thomas'' talks at the recent Calgary NFJS, and would > REALLY like to take RoR for a spin, but this problem has me stumped! >Do you have a ''products'' table in the database? Is database.yml correctly configured so that rails can actually connect? Look at your database logs to see if rails is even connecting. Then check to make sure your ''products'' database exists and is writable by the database user configured in database.yml. Chris _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Thanks for the quick response Chris. Yes, to all of your questions. I created the three databases, users, and the products table in the database exactly as per the book. Rails does connect, because if I change the username or password in the database.yml config file, it complains about not being able to connect. I delved into the rails code a little and it seems that error message comes from a create_sandbox method in the scaffold_generator when a ActiveRecord::StatementInvalid exception is thrown. Dunno, maybe that triggers something with someone who has had similar problems? _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 10/25/05, Hendie Dijkman <ruby-Vki3jUAxBCcyzzc7d281tmfPcZCv/ETZ@public.gmane.org> wrote:> > Thanks for the quick response Chris. > > Yes, to all of your questions. I created the three databases, users, and > the products table in the database exactly as per the book. Rails does > connect, because if I change the username or password in the database.ymlconfig file, it complains about not being able to connect. > > I delved into the rails code a little and it seems that error message > comes from a create_sandbox method in the scaffold_generator when a > ActiveRecord::StatementInvalid exception is thrown. Dunno, maybe that > triggers something with someone who has had similar problems? >I''m probably not much help at this point, but my thought is that it''s database related. If it''s not on already, turn on query logging in the database and then look at the log after trying to create the scaffolding. There is probably something there that will give you an idea of where the problem is. Chris Chris _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
I turned on logging, and this is what shows (results still the same as initially reported) : 051025 15:25:36 9 Connect root@localhost on 9 Query SET SESSION interactive_timeout=1000000 9 Query SELECT @@sql_mode 9 Query SET SESSION sql_mode='''' 9 Query SET NAMES utf8 10 Connect root@localhost on 10 Query SET SESSION interactive_timeout=1000000 10 Query SELECT @@sql_mode 10 Query SET SESSION sql_mode='''' 10 Query SET NAMES utf8 10 Quit 051025 15:25:38 9 Query SHOW VARIABLES LIKE ''datadir'' 9 Query SHOW VARIABLES LIKE ''log_error'' 9 Query SHOW VARIABLES LIKE ''basedir'' _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
I am having a problem when running rails ./script/generate controller mytest /usr/local/lib/site_ruby/1.8/rubygems.rb:144:in `activate'': can''t activate activesupport (= 1.1.1), already activated activesupport-1.2.1] (Gem::Exception) from /usr/local/lib/site_ruby/1.8/rubygems.rb:162:in `activate'' from /usr/local/lib/site_ruby/1.8/rubygems.rb:161:in `each'' from /usr/local/lib/site_ruby/1.8/rubygems.rb:161:in `activate'' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:23:in `require'' from /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.1/lib/active_support/dependencies.rb:213:in `require'' from ./script/../config/environment.rb:51 from ./script/generate:2:in `require'' from ./script/generate:2 any idea? Thanks Manu __________________________________ Yahoo! Mail - PC Magazine Editors'' Choice 2005 http://mail.yahoo.com
> I am having a problem when running railsSounds like your gem installation is botched. Uninstall all your Rails gems and install them again with "gem install rails --include-dependencies". -- David Heinemeier Hansson http://www.loudthinking.com -- Broadcasting Brain http://www.basecamphq.com -- Online project management http://www.backpackit.com -- Personal information manager http://www.rubyonrails.com -- Web-application framework
I’m getting the same problem using latest version of rails, even uninstalled/reinstalled. No dice. Latest Beta no dice. Database exists with table in it. Using XP Pro SP2, MySQL 5.0. I’m going to try out tonight on my old Powerbook just to make sure it’s not a problem between Keyboard and Chair. Initially on a fresh rails install (brand new laptop) couldn’t connect used set old_password query to update user, cool - rails connects, but now can’t generate controller. D:\minihaus.serv\testnerd>ruby script/generate scaffold people admin exists app/controllers/ exists app/helpers/ exists app/views/admin exists test/functional/ dependency model exists app/models/ exists test/unit/ exists test/fixtures/ identical app/models/people.rb identical test/unit/people_test.rb identical test/fixtures/peoples.yml error Before updating scaffolding from new DB schema, try creating a tab le for your model (People) Kindest Regards, Rowan _____ From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Hendie Dijkman Sent: Wednesday, October 26, 2005 8:26 AM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails] Problems with Scaffolding ... Thanks for the quick response Chris. Yes, to all of your questions. I created the three databases, users, and the products table in the database exactly as per the book. Rails does connect, because if I change the username or password in the database.yml config file, it complains about not being able to connect. I delved into the rails code a little and it seems that error message comes from a create_sandbox method in the scaffold_generator when a ActiveRecord::StatementInvalid exception is thrown. Dunno, maybe that triggers something with someone who has had similar problems? -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.362 / Virus Database: 267.12.6/152 - Release Date: 10/31/2005 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.362 / Virus Database: 267.12.6/152 - Release Date: 10/31/2005 _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Rowan, Try: script/generate scaffold Person Admin You have a model Person, which will use a database table people, due to the pluralization rules. Hope this helps, Cody On 11/2/05, Rowan Hick <rowan-qL2YrhN2O5vo4RNKbIU+YqVXKuFTiq87@public.gmane.org> wrote:> > > > I''m getting the same problem using latest version of rails, even > uninstalled/reinstalled. No dice. Latest Beta no dice. Database exists with > table in it. Using XP Pro SP2, MySQL 5.0. I''m going to try out tonight on my > old Powerbook just to make sure it''s not a problem between Keyboard and > Chair. > > > > Initially on a fresh rails install (brand new laptop) couldn''t connect used > set old_password query to update user, cool - rails connects, but now can''t > generate controller. > > > > D:\minihaus.serv\testnerd>ruby script/generate scaffold people admin > > exists app/controllers/ > > exists app/helpers/ > > exists app/views/admin > > exists test/functional/ > > dependency model > > exists app/models/ > > exists test/unit/ > > exists test/fixtures/ > > identical app/models/people.rb > > identical test/unit/people_test.rb > > identical test/fixtures/peoples.yml > > error Before updating scaffolding from new DB schema, try creating a > tab > > le for your model (People) > > > > > > Kindest Regards, > > > > Rowan > > > > > > ________________________________ > > > From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of > Hendie Dijkman > Sent: Wednesday, October 26, 2005 8:26 AM > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: Re: [Rails] Problems with Scaffolding ... > > > > Thanks for the quick response Chris. > > Yes, to all of your questions. I created the three databases, users, and > the products table in the database exactly as per the book. Rails does > connect, because if I change the username or password in the database.yml > config file, it complains about not being able to connect. > > I delved into the rails code a little and it seems that error message comes > from a create_sandbox method in the scaffold_generator when a > ActiveRecord::StatementInvalid exception is thrown. Dunno, maybe that > triggers something with someone who has had similar problems? > > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.362 / Virus Database: 267.12.6/152 - Release Date: 10/31/2005 > > > -- > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.1.362 / Virus Database: 267.12.6/152 - Release Date: 10/31/2005 > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
Cody, I''m a retard, it''s all working a whole lot better now. Even read about it and know about still caught me out. Many thanks, Rowan -----Original Message----- From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Cody Fauser Sent: Thursday, November 03, 2005 4:17 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails] Problems with Scaffolding ... Rowan, Try: script/generate scaffold Person Admin You have a model Person, which will use a database table people, due to the pluralization rules. Hope this helps, Cody -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.362 / Virus Database: 267.12.6/152 - Release Date: 10/31/2005