Skip to content

Instantly share code, notes, and snippets.

@muiz
Created May 13, 2011 03:53
Show Gist options
  • Save muiz/969938 to your computer and use it in GitHub Desktop.
Save muiz/969938 to your computer and use it in GitHub Desktop.
rake db:migate failed ( sqlite3, jruby on Rails 3.1.0.beta1 )
What's wrong with db:migrate?
commands:
jruby -S rails new iapple2 -m http://jruby.org/rails3.rb
cd iapple2
jruby -S rails generate scaffold Product name:string capacity:string color:string price:string logistics:string
rake db:migrate --trace
(in /home/sysadmin/Workspaces/Projects/iapple2)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:migrate
== CreateProducts: migrating =================================================
-- create_table(:products)
-> 0.0020s
-> 0 rows
== CreateProducts: migrated (0.0030s) ========================================
rake aborted!
An error has occurred, this and all later migrations canceled:
undefined method `rows' for nil:NilClass
org/jruby/RubyKernel.java:238:in `method_missing'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/activesupport-3.1.0.beta1/lib/active_support/whiny_nil.rb:48:in `method_missing'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/activerecord-3.1.0.beta1/lib/active_record/connection_adapters/abstract/database_statements.rb:399:in `last_inserted_id'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/activerecord-3.1.0.beta1/lib/active_record/connection_adapters/abstract/database_statements.rb:90:in `insert'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/activerecord-3.1.0.beta1/lib/active_record/connection_adapters/abstract/query_cache.rb:19:in `insert'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/activerecord-3.1.0.beta1/lib/active_record/migration.rb:719:in `record_version_state_after_migrating'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/activerecord-3.1.0.beta1/lib/active_record/migration.rb:680:in `migrate'
org/jruby/RubyProc.java:268:in `call'
org/jruby/RubyProc.java:228:in `call'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/activerecord-3.1.0.beta1/lib/active_record/migration.rb:734:in `ddl_transaction'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/activerecord-3.1.0.beta1/lib/active_record/connection_adapters/abstract/database_statements.rb:191:in `transaction'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/activerecord-3.1.0.beta1/lib/active_record/transactions.rb:208:in `transaction'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/activerecord-3.1.0.beta1/lib/active_record/migration.rb:734:in `ddl_transaction'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/activerecord-3.1.0.beta1/lib/active_record/migration.rb:678:in `migrate'
org/jruby/RubyArray.java:1602:in `each'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/activerecord-3.1.0.beta1/lib/active_record/migration.rb:663:in `migrate'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/activerecord-3.1.0.beta1/lib/active_record/migration.rb:541:in `up'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/activerecord-3.1.0.beta1/lib/active_record/migration.rb:522:in `migrate'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/activerecord-3.1.0.beta1/lib/active_record/railties/databases.rake:157:in `(root)'
org/jruby/RubyProc.java:268:in `call'
org/jruby/RubyProc.java:228:in `call'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
org/jruby/RubyArray.java:1602:in `each'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/opt/ruby/jruby-1.6.1/lib/ruby/1.8/monitor.rb:191:in `mon_synchronize'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
org/jruby/RubyArray.java:1602:in `each'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/opt/ruby/jruby-1.6.1/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31:in `(root)'
org/jruby/RubyKernel.java:1063:in `load'
/opt/ruby/jruby-1.6.1/bin/rake:19:in `(root)'
@adamdilek
Copy link

Have you solved the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment