db:migrate fails after creating table pages (new installation) #8

Closed
jenzer opened this Issue Oct 26, 2011 · 5 comments

Projects

None yet

2 participants

@jenzer
Contributor
jenzer commented Oct 26, 2011

info@Marcs-MacBook-Pro:~/Desktop/customers/hotz/website/hotz-web $ bundle exec rake db:migrate --trace
** 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
== CreateKuhsaftPages: migrating =============================================
-- create_table(:pages)
-> 0.1385s
== CreateKuhsaftPages: migrated (0.1386s) ====================================

rake aborted!
An error has occurred, all later migrations canceled:

undefined method rows' for nil:NilClass /Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/activesupport-3.1.1/lib/active_support/whiny_nil.rb:48:inmethod_missing'
/Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:410:in last_inserted_id' /Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:91:ininsert'
/Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/query_cache.rb:14:in insert' /Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/activerecord-3.1.1/lib/active_record/migration.rb:727:inrecord_version_state_after_migrating'
/Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/activerecord-3.1.1/lib/active_record/migration.rb:688:in migrate' /Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/activerecord-3.1.1/lib/active_record/migration.rb:744:incall'
/Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/activerecord-3.1.1/lib/active_record/migration.rb:744:in ddl_transaction' /Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/activerecord-3.1.1/lib/active_record/migration.rb:686:inmigrate'
/Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/activerecord-3.1.1/lib/active_record/migration.rb:671:in each' /Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/activerecord-3.1.1/lib/active_record/migration.rb:671:inmigrate'
/Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/activerecord-3.1.1/lib/active_record/migration.rb:549:in up' /Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/activerecord-3.1.1/lib/active_record/migration.rb:530:inmigrate'
/Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/activerecord-3.1.1/lib/active_record/railties/databases.rake:161
/Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:205:in call' /Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:205:inexecute'
/Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:200:in each' /Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:200:inexecute'
/Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:158:in invoke_with_call_chain' /Users/info/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/1.8/monitor.rb:242:insynchronize'
/Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:151:in invoke_with_call_chain' /Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:144:ininvoke'
/Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:116:in invoke_task' /Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:94:intop_level'
/Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:94:in each' /Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:94:intop_level'
/Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:133:in standard_exception_handling' /Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:88:intop_level'
/Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:66:in run' /Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:133:instandard_exception_handling'
/Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:63:in run' /Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/gems/rake-0.9.2.2/bin/rake:33 /Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/bin/rake:19:inload'
/Users/info/.rvm/gems/ruby-1.8.7-p299@rails31/bin/rake:19
Tasks: TOP => db:migrate

Contributor

Could you attach your Gemfile/Gemfile.lock? A quick google revealed that this might be a mysql issue...

Contributor
jenzer commented Oct 26, 2011

GEM
remote: http://rubygems.org/
specs:
actionmailer (3.1.1)
actionpack (= 3.1.1)
mail (> 2.3.0)
actionpack (3.1.1)
activemodel (= 3.1.1)
activesupport (= 3.1.1)
builder (
> 3.0.0)
erubis (> 2.7.0)
i18n (
> 0.6)
rack (> 1.3.2)
rack-cache (
> 1.1)
rack-mount (> 0.8.2)
rack-test (
> 0.6.1)
sprockets (> 2.0.2)
activemodel (3.1.1)
activesupport (= 3.1.1)
builder (
> 3.0.0)
i18n (> 0.6)
activerecord (3.1.1)
activemodel (= 3.1.1)
activesupport (= 3.1.1)
arel (
> 2.2.1)
tzinfo (> 0.3.29)
activeresource (3.1.1)
activemodel (= 3.1.1)
activesupport (= 3.1.1)
activesupport (3.1.1)
multi_json (
> 1.0)
acts-as-taggable-on (2.1.1)
rails
arel (2.2.1)
builder (3.0.0)
carrierwave (0.5.7)
activesupport (> 3.0)
chunky_png (1.2.5)
coffee-rails (3.1.1)
coffee-script (>= 2.2.0)
railties (
> 3.1.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.1.2)
columnize (0.3.4)
compass (0.11.5)
chunky_png (> 1.2)
fssm (>= 0.2.7)
sass (
> 3.1)
diff-lcs (1.1.3)
erubis (2.7.0)
execjs (1.2.9)
multi_json (> 1.0)
fssm (0.2.7)
haml (3.1.3)
haml-rails (0.3.4)
actionpack (
> 3.0)
activesupport (> 3.0)
haml (
> 3.0)
railties (> 3.0)
hike (1.2.1)
i18n (0.6.0)
jquery-rails (1.0.16)
railties (
> 3.0)
thor (> 0.14)
json (1.6.1)
kuhsaft (0.3.2)
acts-as-taggable-on (>= 2.0.6)
carrierwave (>= 0.5.7)
compass (>= 0.11.1)
haml (
> 3.1)
rails (> 3.1)
rdiscount (>= 1.6)
rmagick (= 2.12.2)
simple_form (>= 1.4)
linecache (0.46)
rbx-require-relative (> 0.0.4)
mail (2.3.0)
i18n (>= 0.4.0)
mime-types (
> 1.16)
treetop (> 1.4.8)
mime-types (1.17.1)
multi_json (1.0.3)
mysql2 (0.2.7)
polyglot (0.3.2)
rack (1.3.5)
rack-cache (1.1)
rack (>= 0.4)
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.1.1)
actionmailer (= 3.1.1)
actionpack (= 3.1.1)
activerecord (= 3.1.1)
activeresource (= 3.1.1)
activesupport (= 3.1.1)
bundler (
> 1.0)
railties (= 3.1.1)
railties (3.1.1)
actionpack (= 3.1.1)
activesupport (= 3.1.1)
rack-ssl (> 1.3.2)
rake (>= 0.8.7)
rdoc (
> 3.4)
thor (> 0.14.6)
rake (0.9.2.2)
rbx-require-relative (0.0.5)
rdiscount (1.6.8)
rdoc (3.11)
json (
> 1.4)
rmagick (2.12.2)
rspec (2.7.0)
rspec-core (> 2.7.0)
rspec-expectations (
> 2.7.0)
rspec-mocks (> 2.7.0)
rspec-core (2.7.1)
rspec-expectations (2.7.0)
diff-lcs (
> 1.1.2)
rspec-mocks (2.7.0)
rspec-rails (2.7.0)
actionpack (> 3.0)
activesupport (
> 3.0)
railties (> 3.0)
rspec (
> 2.7.0)
ruby-debug (0.10.4)
columnize (>= 0.1)
ruby-debug-base (> 0.10.4.0)
ruby-debug-base (0.10.4)
linecache (>= 0.3)
sass (3.1.10)
sass-rails (3.1.4)
actionpack (
> 3.1.0)
railties (> 3.1.0)
sass (>= 3.1.4)
sprockets (
> 2.0.0)
tilt (> 1.3.2)
simple_form (1.5.2)
actionpack (
> 3.0)
activemodel (> 3.0)
sprockets (2.0.3)
hike (
> 1.2)
rack (> 1.0)
tilt (
> 1.1, != 1.3.0)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.30)
uglifier (1.0.4)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)

PLATFORMS
ruby

DEPENDENCIES
coffee-rails (> 3.1.1)
haml-rails
jquery-rails
json
kuhsaft
mysql2
rails (= 3.1.1)
rspec-rails
ruby-debug
sass-rails (
> 3.1.4)
uglifier (>= 1.0.3)

Contributor
jenzer commented Oct 26, 2011

source 'http://rubygems.org'

gem 'rails', '3.1.1'
gem 'mysql2'
gem 'haml-rails'
gem 'jquery-rails'
gem 'json'

Gems used only for assets and not required

in production environments by default.

group :assets do
gem 'sass-rails', '> 3.1.4'
gem 'coffee-rails', '
> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end

group :test, :development do
gem "rspec-rails"
gem "ruby-debug", :platform => :ruby
end

gem 'kuhsaft'

Contributor
jenzer commented Oct 26, 2011

I replaced
gem 'mysql2'
with
gem 'mysql2', '0.3.6'

now everything works fine...

@jenzer jenzer closed this Oct 26, 2011
Contributor

maybe try upgrading the mysql2 gem to something like > 0.3 or try the master branch, seems to be an issue with mysql2

gem 'mysql2', :git => 'git://github.com/brianmario/mysql2.git'

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