ruby on rails - `heroku open` fails - table doesn't exist error in logs -


edit:

while trying working, commented out offending factory_girl entirely - , it's still giving same error -

cannot load such file -- factory_girl_rails  /app/lib/tasks/sample_data.rake:1:in require'  

is there need make heroku work with/see updated files?

op:

heroku open returns we're sorry, went wrong. in browser , following heroku logs:

2013-08-23t21:18:48.870042+00:00 app[web.1]: started "/" 86.59.188.18 @ 2013-08-23 21:18:48 +0000 2013-08-23t21:18:49.388611+00:00 app[web.1]: 2013-08-23t21:18:49.388611+00:00 app[web.1]: activerecord::statementinvalid (mysql2::error: table 'heroku_9e0ff302f567892.users' doesn't exist: show full fields `users`): 2013-08-23t21:18:49.388611+00:00 app[web.1]:   app/models/user.rb:52:in `authenticate_with_salt' 2013-08-23t21:18:49.388611+00:00 app[web.1]:   app/helpers/sessions_helper.rb:62:in `user_from_remember_token' 2013-08-23t21:18:49.388611+00:00 app[web.1]:   app/helpers/sessions_helper.rb:32:in `current_user' 2013-08-23t21:18:49.388611+00:00 app[web.1]:   app/helpers/sessions_helper.rb:13:in `logged_in?' 2013-08-23t21:18:49.388611+00:00 app[web.1]:   app/controllers/pages_controller.rb:32:in `home' 2013-08-23t21:18:49.388611+00:00 app[web.1]: 2013-08-23t21:18:49.388611+00:00 app[web.1]: 2013-08-23t21:18:49.388906+00:00 app[web.1]: processing pagescontroller#home html 2013-08-23t21:18:49.388906+00:00 app[web.1]: completed 500 internal server error in 5ms 2013-08-23t21:18:49.390347+00:00 heroku[router]: at=info method=get path=/ host=shrouded-caverns-2325.herokuapp.com fwd="86.59.188.18" dyno=web.1 connect=2ms service=528ms status=500 bytes=643 

running heroku run rake db:schema:load --trace returns:

rake aborted! cannot load such file -- factory_girl_rails /app/lib/tasks/sample_data.rake:1:in `require' /app/lib/tasks/sample_data.rake:1:in `<top (required)>' /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:425:in `load' /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:425:in `block in load_tasks' /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:425:in `each' /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:425:in `load_tasks' /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/application.rb:145:in `load_tasks' /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing' /app/rakefile:7:in `<top (required)>' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load_rakefile' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:637:in `raw_load_rakefile' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:94:in `block in load_rakefile' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:93:in `load_rakefile' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:77:in `block in run' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:75:in `run' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/bin/rake:33:in `<top (required)>' /app/vendor/bundle/ruby/2.0.0/bin/rake:23:in `load' /app/vendor/bundle/ruby/2.0.0/bin/rake:23:in `<main>' 

the file throwing factory girl error:

namespace :db    desc "fill db sample data"    task :populate, :environment      require 'factory_girl_rails'      ...    end  end 

gemfile:

source 'https://rubygems.org'  gem 'rails', '3.2.13'  # bundle edge rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git'  gem "autotest" gem 'autotest-growl' gem 'webrat' gem "json", "~> 1.4" gem "thor", "~> 0.17.0" gem "cocoon" gem 'jquery_datepicker'  #db  gem "mysql2" gem "pg"  #groups   #development  group :development    gem "rspec-rails"   gem "annotate"   gem "faker"  end  #test  group :test    gem "rspec"   gem 'factory_girl_rails', :require => false  end   # gems used assets , not required # in production environments default. group :assets   gem 'sass-rails',   '~> 3.2.3'   gem 'coffee-rails', '~> 3.2.1'   gem 'uglifier', '>= 1.0.3' end  # gem 'jquery-rails' (http://stackoverflow.com/a/17053795/2128691) gem 'jquery-rails', '~> 2.3.0' 

the reason throwing error because factory girl rails install in "test" mode. on heroku app in "production" mode unless specify otherwise. i'd take out require populate task. you're better off creating factories on test test basis. see https://github.com/thoughtbot/factory_girl/wiki/usage

the other option install factory girl in production mode. simple take gem 'factory-girl-rails' out of test group.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -