rajasekar98-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Nov-07 11:57 UTC
Ruby on Rails & SQLite3
Hi, I''m just a beginner in Ruby. Have just installed Rails and Gems. I am using SQLite3 as the db. When going thro the "CookBook" tutorial. after creating the recipes table in the sqlite3 database. and changing the config file - database.yml as development: adapter: sqlite3 dbfile: db/test.db test: adapter: sqlite3 dbfile: db/test.db production: adapter: sqlite3 dbfile: db/test.db and when trying to scaffold the recipe table from the browser using - http://localhost:3000/recipe/new I''m getting the following error <Error> ActiveRecord::StatementInvalid in RecipeController#new ActiveRecord::StatementInvalid RAILS_ROOT: ./script/../config/.. Show session dump --- flash: !map:ActionController::Flash::FlashHash {} Response Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} </error> Could anybody tell me, where i am going wrong?? Thanks in advance. Raj --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
1. Did you migrate 2. Did you restart WEBrick 3. is SQLite3 on your path? 4. Did you do gem install sqlite3-ruby Let me know and we can go from there. On 11/7/06, rajasekar98-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <rajasekar98-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hi, > > I''m just a beginner in Ruby. > Have just installed Rails and Gems. > I am using SQLite3 as the db. > > When going thro the "CookBook" tutorial. > after creating the recipes table in the sqlite3 database. > and changing the config file - database.yml as > > development: > adapter: sqlite3 > dbfile: db/test.db > > test: > adapter: sqlite3 > dbfile: db/test.db > > production: > adapter: sqlite3 > dbfile: db/test.db > > > and when trying to scaffold the recipe table from the browser using - > http://localhost:3000/recipe/new > > I''m getting the following error > > <Error> > ActiveRecord::StatementInvalid in RecipeController#new > > ActiveRecord::StatementInvalid > RAILS_ROOT: ./script/../config/.. > > Show session dump > > --- > flash: !map:ActionController::Flash::FlashHash {} > > > Response > Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} > </error> > > Could anybody tell me, where i am going wrong?? > > Thanks in advance. > > Raj > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
rajasekar98-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Nov-08 06:27 UTC
Re: Ruby on Rails & SQLite3
Hi Brian, 1. Did you migrate No , i did not migrate 2. Did you restart WEBrick yes, Had restarted WEBrick after changing the config files. 3. is SQLite3 on your path? Yes, SQLite3 is set in my path. 4. Did you do gem install sqlite3-ruby Yes, i have used gem install sqlite3-ruby-1.1.0 and have installed the latest version of mswin32.gem What would the problem be.?? Raj On Nov 8, 1:20 am, "Brian Hogan" <bpho...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 1. Did you migrate > 2. Did you restart WEBrick > 3. is SQLite3 on your path? > 4. Did you do gem install sqlite3-ruby > > Let me know and we can go from there. > > On 11/7/06, rajaseka...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <rajaseka...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi, > > > I''m just a beginner in Ruby. > > Have just installed Rails and Gems. > > I am using SQLite3 as the db. > > > When going thro the "CookBook" tutorial. > > after creating the recipes table in the sqlite3 database. > > and changing the config file - database.yml as > > > development: > > adapter: sqlite3 > > dbfile: db/test.db > > > test: > > adapter: sqlite3 > > dbfile: db/test.db > > > production: > > adapter: sqlite3 > > dbfile: db/test.db > > > and when trying to scaffold the recipe table from the browser using - > >http://localhost:3000/recipe/new > > > I''m getting the following error > > > <Error> > > ActiveRecord::StatementInvalid in RecipeController#new > > > ActiveRecord::StatementInvalid > > RAILS_ROOT: ./script/../config/.. > > > Show session dump > > > --- > > flash: !map:ActionController::Flash::FlashHash {} > > > Response > > Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} > > </error> > > > Could anybody tell me, where i am going wrong?? > > > Thanks in advance. > > > Raj--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Did you try creating a new recipe via the console? cd to the root of your rails application and enter: ruby script/console in the console enter r = Receipe.new r.save And check what happens. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I haven''t developed anything on windows for a while but iirc you have to specify the full path to your db, i.e. dbfile: c:/yourapp/db/test.db I cannot remember if it''s forward of back slashes, you should try both You may also want to look at this - http://redhanded.hobix.com/cult/sqlite3Gem_whySSensibilitiesRepack.html easiest option for windows by the look of things. On Wednesday 08 November 2006 06:27, rajasekar98-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> Hi Brian, > > 1. Did you migrate > No , i did not migrate > > 2. Did you restart WEBrick > yes, Had restarted WEBrick after changing the config files. > > 3. is SQLite3 on your path? > Yes, SQLite3 is set in my path. > > 4. Did you do gem install sqlite3-ruby > Yes, i have used gem install sqlite3-ruby-1.1.0 > and have installed the latest version of mswin32.gem > > What would the problem be.?? > > Raj > > On Nov 8, 1:20 am, "Brian Hogan" <bpho...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > 1. Did you migrate > > 2. Did you restart WEBrick > > 3. is SQLite3 on your path? > > 4. Did you do gem install sqlite3-ruby > > > > Let me know and we can go from there. > > > > On 11/7/06, rajaseka...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <rajaseka...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi, > > > > > > I''m just a beginner in Ruby. > > > Have just installed Rails and Gems. > > > I am using SQLite3 as the db. > > > > > > When going thro the "CookBook" tutorial. > > > after creating the recipes table in the sqlite3 database. > > > and changing the config file - database.yml as > > > > > > development: > > > adapter: sqlite3 > > > dbfile: db/test.db > > > > > > test: > > > adapter: sqlite3 > > > dbfile: db/test.db > > > > > > production: > > > adapter: sqlite3 > > > dbfile: db/test.db > > > > > > and when trying to scaffold the recipe table from the browser using - > > >http://localhost:3000/recipe/new > > > > > > I''m getting the following error > > > > > > <Error> > > > ActiveRecord::StatementInvalid in RecipeController#new > > > > > > ActiveRecord::StatementInvalid > > > RAILS_ROOT: ./script/../config/.. > > > > > > Show session dump > > > > > > --- > > > flash: !map:ActionController::Flash::FlashHash {} > > > > > > Response > > > Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} > > > </error> > > > > > > Could anybody tell me, where i am going wrong?? > > > > > > Thanks in advance. > > > > > > Raj > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
The full path is not required in windows. dbfile: db/test.db is fine. On Nov 8, 12:56 pm, Scott Mathieson <uberk...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I haven''t developed anything on windows for a while but iirc you have to > specify the full path to your db, i.e. > > dbfile: c:/yourapp/db/test.db > > I cannot remember if it''s forward of back slashes, you should try both > > You may also want to look at this -http://redhanded.hobix.com/cult/sqlite3Gem_whySSensibilitiesRepack.html > > easiest option for windows by the look of things. > > On Wednesday 08 November 2006 06:27, rajaseka...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: > > > Hi Brian, > > > 1. Did you migrate > > No , i did not migrate > > > 2. Did you restart WEBrick > > yes, Had restarted WEBrick after changing the config files. > > > 3. is SQLite3 on your path? > > Yes, SQLite3 is set in my path. > > > 4. Did you do gem install sqlite3-ruby > > Yes, i have used gem install sqlite3-ruby-1.1.0 > > and have installed the latest version of mswin32.gem > > > What would the problem be.?? > > > Raj > > > On Nov 8, 1:20 am, "Brian Hogan" <bpho...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > 1. Did you migrate > > > 2. Did you restart WEBrick > > > 3. is SQLite3 on your path? > > > 4. Did you do gem install sqlite3-ruby > > > > Let me know and we can go from there. > > > > On 11/7/06, rajaseka...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <rajaseka...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi, > > > > > I''m just a beginner in Ruby. > > > > Have just installed Rails and Gems. > > > > I am using SQLite3 as the db. > > > > > When going thro the "CookBook" tutorial. > > > > after creating the recipes table in the sqlite3 database. > > > > and changing the config file - database.yml as > > > > > development: > > > > adapter: sqlite3 > > > > dbfile: db/test.db > > > > > test: > > > > adapter: sqlite3 > > > > dbfile: db/test.db > > > > > production: > > > > adapter: sqlite3 > > > > dbfile: db/test.db > > > > > and when trying to scaffold the recipe table from the browser using - > > > >http://localhost:3000/recipe/new > > > > > I''m getting the following error > > > > > <Error> > > > > ActiveRecord::StatementInvalid in RecipeController#new > > > > > ActiveRecord::StatementInvalid > > > > RAILS_ROOT: ./script/../config/.. > > > > > Show session dump > > > > > --- > > > > flash: !map:ActionController::Flash::FlashHash {} > > > > > Response > > > > Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} > > > > </error> > > > > > Could anybody tell me, where i am going wrong?? > > > > > Thanks in advance. > > > > > Raj--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
rajasekar98-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Nov-09 11:40 UTC
Re: Ruby on Rails & SQLite3
Hi Malmeida, Tried r = Receipe.new using ruby script/console. Am getting the same error ActiveRecord::StatementInvalid: ActiveRecord::StatementInvalid from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_recor d/connection_adapters/sqlite_adapter.rb:259:in `table_structure'' from C:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_suppo rt/core_ext/object/misc.rb:23:in `returning'' from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_recor d/connection_adapters/sqlite_adapter.rb:258:in `table_structure'' from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_recor d/connection_adapters/sqlite_adapter.rb:196:in `columns'' from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_recor d/base.rb:696:in `columns'' from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_recor d/base.rb:1969:in `attributes_from_column_definition'' from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_recor d/base.rb:1351:in `initialize_without_callbacks'' from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_recor d/callbacks.rb:236:in `initialize'' from (irb):1:in `new'' from (irb):1 Active Record::Statement Invalid Been stuck with this for the past 1 week. Would be really happy if anybody could help me solve this problem :-) Raj On Nov 8, 5:53 pm, "malmeida" <malme...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Did you try creating a new recipe via the console? > > cd to the root of your rails application and enter: > > ruby script/console > > in the console enter > > r = Receipe.new > r.save > > And check what happens.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
What does your model look like? You did not migrate, so did you even create a table Recipe in the database? What does your table structure look like? You can fire up sqlite and dump the table structure> sqlite db/dev.db> .dumpThat should print out what your tables look like. It could be table name and your model names are not matching (Rails magically assumes pluralized table names, but the model names are singular, etc.), or you might not even have a Recipe table in your db. Another question. Are you spelling Recipe or Receipe?! In the above posts, I see Receipe but should be Recipe. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---