I am getting the same error after running the gem once again.
ActiveRecord::StatementInvalid in RecipeController#new
Any idea , what are the other reasons for such an error.
Raj
···
On Nov 8, 1:34 am, Stephan Kämper <sigma.ka...@stephankaemper.de> wrote:
rajaseka...@gmail.com 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..
> I'm getting the following error
> <Error>
> ActiveRecord::StatementInvalid in RecipeController#new
Thanks for ur reply.
Really have got stuck in this problem for the last 1 week.
Have changed the database name like something_test.db.
But stil i am facing the same problem.
Need a clarification.
What is the need for having Production, Test and development attributes
in the config file.
What will happen if i comment the Production and the Development
attributes in the config file.
Raj
···
On Nov 9, 1:10 am, Stephan Kämper <sigma.ka...@stephankaemper.de> wrote:
rajaseka...@gmail.com wrote:
> Hi Stephan,
> Any idea , what are the other reasons for such an error.Well, know that I've read your database.yaml it might also be due to
some entries there:
> production:
> adapter: sqlite3
> dbfile: db/test.dbFirst of all the databases for test, development and production should
never be the same. Really never, or you may and will loose data.
Second of all ... in my yaml file it actually says
> test:
> adapter: sqlite3
> database: db/something_test.db3But then, the documentation I have only states dbfile as you wrote. So
here maybe I'm plain wrong, although database works, too. I just checked it.
Thanks for ur reply.
Really have got stuck in this problem for the last 1 week.
Have changed the database name like something_test.db.
But stil i am facing the same problem.
Need a clarification.
What is the need for having Production, Test and development attributes
in the config file.
Well, if you use the same DB all over, you end up using you production database also for developing and testing. That's very, very bad, because you will delete important information from your production system sooner or later (I guess it'll be sooner rather than later).
Apart form that there are a lot more good reasons to keep differentd things separate.
What will happen if i comment the Production and the Development
attributes in the config file.
Well, you can't use these environments any longer. See your favourite Rails documentation for further reference.
BTW. you might also try using the rails-mailing-list for Rails stuff. The folks over there are a lot more Rails-oriented than here on the Ruby list (resp. news group).