lxp149
2008-Feb-09 05:18 UTC
Why do I get an empty class when I run ruby script/generate scaffold?
I''ve been trying to figure this out since yesterday afternoon with no success. I''ve tried to run ruby with oracle, 11, 10, and as of today 10g XE. The problem is obviously not on the oracle side because I can query the database successfully using the command-line ruby exec command. But after I created an a simple ruby application with a simple database table called emails that contains only one column called email, running the generate scaffold command leaves me with an empty class in email.rb: class Email < ActiveRecord::Base end Isn''t it supposed to populate the class with the database column information? The generate command completed successfully with no errors. I''m totally lost at this point. Any pointers would be greatly appreciated. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
ebrad
2008-Feb-09 06:19 UTC
Re: Why do I get an empty class when I run ruby script/generate scaffold?
The model''s not supposed to populate with anything. The connections are made in ActiveRecord behind the scenes. However, if you created a scaffold, there should be some new files in the app/views/emails directory if you had any columns in your table. On Feb 9, 12:18 am, lxp149 <luying....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''ve been trying to figure this out since yesterday afternoon with no > success. I''ve tried to run ruby with oracle, 11, 10, and as of today > 10g XE. The problem is obviously not on the oracle side because I can > query the database successfully using the command-line ruby exec > command. > > But after I created an a simple ruby application with a simple > database table called emails that contains only one column called > email, running the generate scaffold command leaves me with an empty > class in email.rb: > > class Email < ActiveRecord::Base > end > > Isn''t it supposed to populate the class with the database column > information? > > The generate command completed successfully with no errors. I''m > totally lost at this point. Any pointers would be greatly appreciated.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
lxp149
2008-Feb-11 22:03 UTC
Re: Why do I get an empty class when I run ruby script/generate scaffold?
Still confused. Shouldn''t the database migration .rb file under db/ migrate contain something that looks like my column names? I don''t see any files that contains any of my column names. On Feb 8, 10:19 pm, ebrad <nisguy_...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> The model''s not supposed to populate with anything. The connections > are made in ActiveRecord behind the scenes. However, if you created a > scaffold, there should be some new files in the app/views/emails > directory if you had any columns in your table. > > On Feb 9, 12:18 am,lxp149<luying....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > I''ve been trying to figure this out since yesterday afternoon with no > > success. I''ve tried to run ruby with oracle, 11, 10, and as of today > > 10g XE. The problem is obviously not on the oracle side because I can > > query the database successfully using the command-line ruby exec > > command. > > > But after I created an a simple ruby application with a simple > > database table called emails that contains only one column called > > email, running the generate scaffold command leaves me with an empty > > class in email.rb: > > > class Email < ActiveRecord::Base > > end > > > Isn''t it supposed to populate the class with the database column > > information? > > > The generate command completed successfully with no errors. I''m > > totally lost at this point. Any pointers would be greatly appreciated.- Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Rick DeNatale
2008-Feb-11 22:50 UTC
Re: Why do I get an empty class when I run ruby script/generate scaffold?
On 2/11/08, lxp149 <luying.pan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Still confused. Shouldn''t the database migration .rb file under db/ > migrate contain something that looks like my column names? I don''t see > any files that contains any of my column names.> > On Feb 9, 12:18 am,lxp149<luying....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > I''ve been trying to figure this out since yesterday afternoon with no > > > success. I''ve tried to run ruby with oracle, 11, 10, and as of today > > > 10g XE. The problem is obviously not on the oracle side because I can > > > query the database successfully using the command-line ruby exec > > > command. > > > > > But after I created an a simple ruby application with a simple > > > database table called emails that contains only one column called > > > email, running the generate scaffold command leaves me with an empty > > > class in email.rb:It sound like you somehow created the table first then tried to use script/generate scaffold This isn''t the way it works. If you did say: script/generate scaffold email body:text recipient:string then it would generate a model, controller, views, AND a migration file which would create a table called emails with three columns: id (the primary key), body, and recipient. script/generate scafold does not READ the database to get a table definition. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.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 -~----------~----~----~----~------~----~------~--~---
heimdull
2008-Feb-11 22:52 UTC
Re: Why do I get an empty class when I run ruby script/generate scaffold?
Sounds like you are missing rake db:migrate ? Your migration files are located at PROJECT/db/migrate/00*.rb --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
lxp149
2008-Feb-12 14:21 UTC
Re: Why do I get an empty class when I run ruby script/generate scaffold?
This link explains my confusion. I almost gave up because I couldn''t get any of the basic tutorials going. http://wiki.rubyonrails.com/rails/pages/ScaffoldGenerator The first sentence says "Rails 2.0.0+ breaks chapter 1 of every existing quality rails tutorial because of scaffolding." Sigh ... it makes me not so hopeful about learning this new platform. This seems to be the general problem with any open source platform. Bad or lack of quality documentation. It''s too easy to get stuck, and too hard to get out of being stuck. On Feb 11, 2:52 pm, heimdull <fre...-RCI/mp9mI1I6GGFevw1D/A@public.gmane.org> wrote:> Sounds like you are missing rake db:migrate ? > > Your migration files are located at PROJECT/db/migrate/00*.rb--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
VM
2008-Feb-12 17:02 UTC
Re: Why do I get an empty class when I run ruby script/generate scaffold?
I don''t think it''s the case of bad or lack of documentation, it''s just a new version that isn''t full covered yet. You can use the tutorials on the rails 1.2.x if you create your application with: rails _1.2.6_, for example. Then you can follow the 1.2.x tutorials to learn rails and after that migrate to 2.0. That''s the path I recommend. []''s Marcos On Feb 12, 12:21 pm, lxp149 <luying....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> This link explains my confusion. I almost gave up because I couldn''t > get any of the basic tutorials going.http://wiki.rubyonrails.com/rails/pages/ScaffoldGenerator > > The first sentence says "Rails 2.0.0+ breaks chapter 1 of every > existing quality rails tutorial because of scaffolding." Sigh ... it > makes me not so hopeful about learning this new platform. This seems > to be the general problem with any open source platform. Bad or lack > of quality documentation. It''s too easy to get stuck, and too hard to > get out of being stuck. > > On Feb 11, 2:52 pm, heimdull <fre...-RCI/mp9mI1I6GGFevw1D/A@public.gmane.org> wrote: > > > Sounds like you are missing rake db:migrate ? > > > Your migration files are located at PROJECT/db/migrate/00*.rb--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
lxp149
2008-Feb-12 22:18 UTC
Re: Why do I get an empty class when I run ruby script/generate scaffold?
Well. All''s good. It''s finally working. I did learn a lot through this digging process. It''s definitely not as easy as a lot of people say though. On Feb 12, 9:02 am, VM <marco...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I don''t think it''s the case of bad or lack of documentation, it''s just > a new version that isn''t full covered yet. > > You can use the tutorials on the rails 1.2.x if you create your > application with: rails _1.2.6_, for example. > > Then you can follow the 1.2.x tutorials to learn rails and after that > migrate to 2.0. That''s the path I recommend. > > []''s > Marcos > > On Feb 12, 12:21 pm, lxp149 <luying....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > This link explains my confusion. I almost gave up because I couldn''t > > get any of the basic tutorials going.http://wiki.rubyonrails.com/rails/pages/ScaffoldGenerator > > > The first sentence says "Rails 2.0.0+ breaks chapter 1 of every > > existing quality rails tutorial because of scaffolding." Sigh ... it > > makes me not so hopeful about learning this new platform. This seems > > to be the general problem with any open source platform. Bad or lack > > of quality documentation. It''s too easy to get stuck, and too hard to > > get out of being stuck. > > > On Feb 11, 2:52 pm, heimdull <fre...-RCI/mp9mI1I6GGFevw1D/A@public.gmane.org> wrote: > > > > Sounds like you are missing rake db:migrate ? > > > > Your migration files are located at PROJECT/db/migrate/00*.rb--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jimmy
2008-Mar-10 03:46 UTC
Re: Why do I get an empty class when I run ruby script/generate scaffold?
I completely agree with you. Half of the tutorials don''t work with the latest release and th changes are quite significant without barealy any compatibility. It is taking forever to find out what is in the present release. So much for the ''agile'' platform. On Feb 12, 3:18 pm, lxp149 <luying....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Well. All''s good. It''s finally working. I did learn a lot through this > digging process. It''s definitely not as easy as a lot of people say > though. > > On Feb 12, 9:02 am, VM <marco...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > I don''t think it''s the case of bad or lack of documentation, it''s just > > a new version that isn''t full covered yet. > > > You can use the tutorials on the rails 1.2.x if you create your > > application with: rails _1.2.6_, for example. > > > Then you can follow the 1.2.x tutorials to learn rails and after that > > migrate to 2.0. That''s the path I recommend. > > > []''s > > Marcos > > > On Feb 12, 12:21 pm, lxp149 <luying....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > This link explains my confusion. I almost gave up because I couldn''t > > > get any of the basic tutorials going.http://wiki.rubyonrails.com/rails/pages/ScaffoldGenerator > > > > The first sentence says "Rails 2.0.0+ breaks chapter 1 of every > > > existing quality rails tutorial because of scaffolding." Sigh ... it > > > makes me not so hopeful about learning this new platform. This seems > > > to be the general problem with any open source platform. Bad or lack > > > of quality documentation. It''s too easy to get stuck, and too hard to > > > get out of being stuck. > > > > On Feb 11, 2:52 pm, heimdull <fre...-RCI/mp9mI1I6GGFevw1D/A@public.gmane.org> wrote: > > > > > Sounds like you are missing rake db:migrate ? > > > > > Your migration files are located at PROJECT/db/migrate/00*.rb- Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Mar-10 10:35 UTC
Re: Why do I get an empty class when I run ruby script/generate scaffold?
On 10 Mar 2008, at 03:46, Jimmy wrote:> > I completely agree with you. Half of the tutorials don''t work with the > latest release and th changes are quite significant without barealy > any compatibility. It is taking forever to find out what is in the > present release. So much for the ''agile'' platform.tutorials have been hit disproportionately hard, because they tend to lean on things that were extracted (scaffolding). My rails 1.2 apps required very little changes (basically just grabbing the plugins for the extracted features). Fred> > > On Feb 12, 3:18 pm, lxp149 <luying....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Well. All''s good. It''s finally working. I did learn a lot through >> this >> digging process. It''s definitely not as easy as a lot of people say >> though. >> >> On Feb 12, 9:02 am, VM <marco...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> >> >>> I don''t think it''s the case of bad or lack of documentation, it''s >>> just >>> a new version that isn''t full covered yet. >> >>> You can use the tutorials on the rails 1.2.x if you create your >>> application with: rails _1.2.6_, for example. >> >>> Then you can follow the 1.2.x tutorials to learn rails and after >>> that >>> migrate to 2.0. That''s the path I recommend. >> >>> []''s >>> Marcos >> >>> On Feb 12, 12:21 pm, lxp149 <luying....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>>> This link explains my confusion. I almost gave up because I >>>> couldn''t >>>> get any of the basic tutorials going.http://wiki.rubyonrails.com/rails/pages/ScaffoldGenerator >> >>>> The first sentence says "Rails 2.0.0+ breaks chapter 1 of every >>>> existing quality rails tutorial because of scaffolding." Sigh ... >>>> it >>>> makes me not so hopeful about learning this new platform. This >>>> seems >>>> to be the general problem with any open source platform. Bad or >>>> lack >>>> of quality documentation. It''s too easy to get stuck, and too >>>> hard to >>>> get out of being stuck. >> >>>> On Feb 11, 2:52 pm, heimdull <fre...-RCI/mp9mI1I6GGFevw1D/A@public.gmane.org> wrote: >> >>>>> Sounds like you are missing rake db:migrate ? >> >>>>> Your migration files are located at PROJECT/db/migrate/00*.rb- >>>>> Hide quoted text - >> >> - Show quoted text - > --~--~---------~--~----~------------~-------~--~----~ > 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 > -~----------~----~----~----~------~----~------~--~--- >
AndyV
2008-Mar-10 13:02 UTC
Re: Why do I get an empty class when I run ruby script/generate scaffold?
I agree. It''s not at all the fault of the framework that the freebie tutorials have failed to keep up. With respect to the tutorials... you get what you paid for. If you''re willing to invest in your Rails education, I''d recommend "The Rails Way" (Fernandez, Addison-Wesley Professional series). It''s as comprehensive a text as you''ll find AND it was written with Rails 2.x in view. Also, railscasts is a great (still free!) source for tutorials. You''ll probably want to concentrate on the later editions since they will cover Rails 2.x as well. On Mar 10, 6:35 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 10 Mar 2008, at 03:46, Jimmy wrote: > > > > > I completely agree with you. Half of the tutorials don''t work with the > > latest release and th changes are quite significant without barealy > > any compatibility. It is taking forever to find out what is in the > > present release. So much for the ''agile'' platform. > > tutorials have been hit disproportionately hard, because they tend to > lean on things that were extracted (scaffolding). > My rails 1.2 apps required very little changes (basically just > grabbing the plugins for the extracted features). > > Fred > > > > > On Feb 12, 3:18 pm, lxp149 <luying....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Well. All''s good. It''s finally working. I did learn a lot through > >> this > >> digging process. It''s definitely not as easy as a lot of people say > >> though. > > >> On Feb 12, 9:02 am, VM <marco...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >>> I don''t think it''s the case of bad or lack of documentation, it''s > >>> just > >>> a new version that isn''t full covered yet. > > >>> You can use the tutorials on the rails 1.2.x if you create your > >>> application with: rails _1.2.6_, for example. > > >>> Then you can follow the 1.2.x tutorials to learn rails and after > >>> that > >>> migrate to 2.0. That''s the path I recommend. > > >>> []''s > >>> Marcos > > >>> On Feb 12, 12:21 pm, lxp149 <luying....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >>>> This link explains my confusion. I almost gave up because I > >>>> couldn''t > >>>> get any of the basic tutorials going.http://wiki.rubyonrails.com/rails/pages/ScaffoldGenerator > > >>>> The first sentence says "Rails 2.0.0+ breaks chapter 1 of every > >>>> existing quality rails tutorial because of scaffolding." Sigh ... > >>>> it > >>>> makes me not so hopeful about learning this new platform. This > >>>> seems > >>>> to be the general problem with any open source platform. Bad or > >>>> lack > >>>> of quality documentation. It''s too easy to get stuck, and too > >>>> hard to > >>>> get out of being stuck. > > >>>> On Feb 11, 2:52 pm, heimdull <fre...-RCI/mp9mI1I6GGFevw1D/A@public.gmane.org> wrote: > > >>>>> Sounds like you are missing rake db:migrate ? > > >>>>> Your migration files are located at PROJECT/db/migrate/00*.rb- > >>>>> Hide quoted text - > > >> - Show quoted text - > > > > > > smime.p7s > 5KDownload--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---