Following the directions in: http://www.xml.com/pub/a/2006/04/19/rest-on-rails.html?page=2 I get through the: rake db:migrate With the tables created properly but then when I run the: rake test:units I get a failure: ActiveRecord::StatementInvalid: RuntimeError: ERROR C23502 Mnull value in column "title" violates not-null constraint FexecMain.c L1750 RExecConstraints: INSERT INTO books ("id") VALUES (2) My only departure from the directions is to use postgresql rather than mysql as the database adapter. -- Posted via http://www.ruby-forum.com/.
I''m not sure which driver you''re using, but it sounds like you''re using this one: Snapshot version ruby-postgres-20051221.tar.gz (2005/12/21) If so, you should use this one instead: Release version ruby-postgres-0.7.1.tar.gz(2003/01/06) Both are available here: http://ruby.scripting.ca/postgres/ And a discussion on this topic can be found here: http://lists.rubyonrails.org/pipermail/rails/2006-March/022710.html -- -- Tom Mornini On Apr 24, 2006, at 9:00 PM, James Bowery wrote:> Following the directions in: > > http://www.xml.com/pub/a/2006/04/19/rest-on-rails.html?page=2 > > I get through the: > > rake db:migrate > > With the tables created properly but then when I run the: > > rake test:units > > I get a failure: > > ActiveRecord::StatementInvalid: RuntimeError: ERROR C23502 Mnull > value in column "title" violates not-null constraint FexecMain.c > L1750 RExecConstraints: INSERT INTO books ("id") VALUES (2) > > My only departure from the directions is to use postgresql rather than > mysql as the database adapter. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
James Bowery
2006-Apr-25 23:47 UTC
[Rails] Re: rake test:units fails on Postgresql due to nil
No joy. I downloaded, zxvf''d it, ruby extconf.rb''ed it, make''ed it and make install''ed it Deleted the tables and reran rake db:migrate Then on make test:units (in /var/www/rails/library) NOTICE: CREATE TABLE will create implicit sequence "books_id_seq" for serial column "books.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "books_pkey" for table "books" /usr/bin/ruby -Ilib:test "/usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb" "test/unit/book_test.rb" Loaded suite /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader Started EWARNING: there is no transaction in progress E Finished in 0.027749 seconds. 1) Error: test_truth(BookTest): ActiveRecord::StatementInvalid: PGError: ERROR: null value in column "title" violates not-null constraint : INSERT INTO books ("id") VALUES (2) /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/abstract_adapter.rb:120:in `log'' Tom Mornini wrote:> I''m not sure which driver you''re using, but it > sounds like you''re using this one: > Snapshot version ruby-postgres-20051221.tar.gz (2005/12/21) > > If so, you should use this one instead: > > Release version ruby-postgres-0.7.1.tar.gz(2003/01/06) > > Both are available here: > > http://ruby.scripting.ca/postgres/ > > And a discussion on this topic can be found here: > > http://lists.rubyonrails.org/pipermail/rails/2006-March/022710.html >-- Posted via http://www.ruby-forum.com/.
Tom Mornini
2006-Apr-26 00:59 UTC
[Rails] Re: rake test:units fails on Postgresql due to nil
Can we see that migration and fixture? -- -- Tom Mornini On Apr 25, 2006, at 4:38 PM, James Bowery wrote:> No joy. > > I downloaded, zxvf''d it, ruby extconf.rb''ed it, make''ed it and make > install''ed it > > Deleted the tables and reran rake db:migrate > > Then on make test:units > > (in /var/www/rails/library) > NOTICE: CREATE TABLE will create implicit sequence "books_id_seq" for > serial column "books.id" > NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index > "books_pkey" for table "books" > /usr/bin/ruby -Ilib:test > "/usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb" > "test/unit/book_test.rb" > Loaded suite > /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader > Started > EWARNING: there is no transaction in progress > E > Finished in 0.027749 seconds. > > 1) Error: > test_truth(BookTest): > ActiveRecord::StatementInvalid: PGError: ERROR: null value in column > "title" violates not-null constraint > : INSERT INTO books ("id") VALUES (2) > /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/ > active_record/connection_adapters/abstract_adapter.rb:120:in > `log'' > > > Tom Mornini wrote: >> I''m not sure which driver you''re using, but it >> sounds like you''re using this one: >> Snapshot version ruby-postgres-20051221.tar.gz (2005/12/21) >> >> If so, you should use this one instead: >> >> Release version ruby-postgres-0.7.1.tar.gz(2003/01/06) >> >> Both are available here: >> >> http://ruby.scripting.ca/postgres/ >> >> And a discussion on this topic can be found here: >> >> http://lists.rubyonrails.org/pipermail/rails/2006-March/022710.html >> > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails