Active Admin Gem - Rails 3.2.3,Heroku错误日志

时间:2012-06-01 06:26:56

标签: ruby-on-rails heroku activeadmin

我在理解错误日志时遇到问题。我使用的是Active Admin,一切都在我的本地服务器上运行良好但是当我推送到Heroku时我无法登录或使用主动管理员。关于问题是什么,我有点困惑。我妻子的前端工作,但是当我第一次尝试登录时,我收到了这个错误。

我跑了

 heroku run rake db:migrate

application.rb中

   config.assets.initialize_on_precompile = false

的routes.rb

 break if ARGV.join.include? 'assets:precompile'

Heroku记录

2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_controller/metal/responder.rb:153:in `respond'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_controller/metal/responder.rb:146:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_controller/metal/mime_responds.rb:239:in `respond_with'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/devise-2.1.0/app/controllers/devise/sessions_controller.rb:9:in `new'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/abstract_controller/base.rb:167:in `process_action'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_controller/metal/rendering.rb:10:in `process_action'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:436:in `_run__2148348972389484395__process_action__581573497384646045__callbacks'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in `__run_callback'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:81:in `run_callbacks'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/abstract_controller/callbacks.rb:17:in `process_action'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_controller/metal/rescue.rb:29:in `process_action'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/notifications.rb:123:in `block in instrument'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/notifications.rb:123:in `instrument'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_controller/metal/params_wrapper.rb:205:in `process_action'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/rai
lties/controller_runtime.rb:18:in `process_action'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/abstract_controller/base.rb:121:in `process'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/abstract_controller/rendering.rb:45:in `process'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_controller/metal.rb:203:in `dispatch'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_controller/metal.rb:246:in `block in action'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:73:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:36:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/routing/mapper.rb:40:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/journey-1.0.3/lib/journey/router.rb:68:in `block in call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/journey-1.0.3/lib/journey/router.rb:56:in `each'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/journey-1.0.3/lib/journey/router.rb:56:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:600:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/sass-3.1.18/lib/sass/plugin/rack.rb:54:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/warden-1.1.1/lib/warden/manager.rb:35:in `block in call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/warden-1.1.1/lib/warden/manager.rb:34:in `catch'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/warden-1.1.1/lib/warden/manager.rb:34:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/etag.rb:23:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/conditionalget.rb:25:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/head.rb:14:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/flash.rb:242:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in `context'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/cookies.rb:338:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/dragonfly-0.9.12/lib/dragonfly/cookie_monster.rb:9:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/query_cache.rb:64:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:467:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in `_run__2527400173333692808__call__757062616006589650__callbacks'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in `__run_callback'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:81:in `run_callbacks'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/rack/logger.rb:26:in `call_app'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/rack/logger.rb:16:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/request_id.rb:22:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/static.rb:62:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/dragonfly-0.9.12/lib/dragonfly/middleware.rb:13:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/engine.rb:479:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/application.rb:220:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/content_length.rb:14:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/rack/log_tailer.rb:14:in `call'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/connection.rb:80:in `block in pre_process'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/connection.rb:78:in `catch'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/connection.rb:78:in `pre_process'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/connection.rb:53:in `process'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/connection.rb:38:in `receive_data'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/backends/base.rb:61:in `start'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/server.rb:159:in `start'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/handler/thin.rb:13:in `run'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:265:in `start'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/commands/server.rb:70:in `start'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/commands.rb:50:in `tap'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/commands.rb:55:in `block in <top (required)>'
2012-06-01T06:11:53+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/commands.rb:50:in `<top (required)>'
2012-06-01T06:11:53+00:00 app[web.1]:   script/rails:6:in `require'
2012-06-01T06:11:53+00:00 app[web.1]:   script/rails:6:in `<main>'
2012-06-01T06:11:53+00:00 app[web.1]: 
2012-06-01T06:11:53+00:00 app[web.1]: 
2012-06-01T06:11:53+00:00 app[web.1]: Processing by ActiveAdmin::Devise::SessionsController#new as HTML
2012-06-01T06:11:53+00:00 app[web.1]:   Rendered vendor/bundle/ruby/1.9.1/bundler/gems/active_admin-3020d04d5c8f/app/views/active_admin/devise/shared/_links.erb (1.1ms)
2012-06-01T06:11:53+00:00 app[web.1]:   Rendered vendor/bundle/ruby/1.9.1/bundler/gems/active_admin-3020d04d5c8f/app/views/active_admin/devise/sessions/new.html.erb within layouts/active_admin_logged_out (292.9ms)
2012-06-01T06:11:53+00:00 app[web.1]: Completed 500 Internal Server Error in 456ms

配置/ ENV / development.rb

 # Do not compress assets
  config.assets.compress = false

  # Expands the lines which load the assets
  config.assets.debug = true

宝石文件

source 'https://rubygems.org'
ruby '1.9.3'
gem 'rails', '3.2.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

group :development do
        gem 'pg'
        #gem 'sqlite3'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'pg'
  gem 'thin'
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platform => :ruby
  gem 'uglifier', '>= 1.0.3'
  gem 'chosen-rails'
end

gem 'jquery-rails'
gem "activeadmin", :git => "git://github.com/gregbell/active_admin.git"
gem "zurb-foundation"
gem "friendly_id", "~> 4.0.1"
gem 'simple_form'
gem 'rack-cache', :require => 'rack/cache'
gem 'dragonfly', '~>0.9.12'
gem "fog"
gem 'rmagick'
gem 'tinymce-rails'

更新

我在我的gemfile上,我现在正在使用

ruby '1.9.3'
gem  'rails', '3.2.5'

但错误日志有

vendor/bundle/ruby/1.9.1/gems/

Heroku不应该为我选择Ruby 1.9.3吗?

5 个答案:

答案 0 :(得分:4)

尝试这两件事:

config/environments/production.rb config.assets.compile = true 
宝石文件中的

gem "activeadmin", :git => "git://github.com/gregbell/active_admin.git"

bundle install

推送到heroku并看到它有效

答案 1 :(得分:2)

gem 'sass-rails', '~> 3.2.3'gem 'pg'移出资产组,捆绑并再次尝试。 我会强制执行rake assets:precompile RAILS_ENV=production 并将public/assets更新添加到我的提交。

如果您想重建资产,只需rm -rf public/assets 并再次运行资产预编译命令。

你可以git rm public/assets --cached -rgit add public/assets

做一次提交并推送到heroku。

答案 2 :(得分:1)

我只是猜测您没有运行迁移,因为 pg gem 隐藏在您的资产组中。如果您尝试在这些条件下运行它们,则在发出heroku run rake db:migrate时可能会出错。

另外,我建议将您的薄宝石放在生产或全球环境中。确保你有Procfile,否则heroku将使用webrick。

答案 3 :(得分:0)

需要将其添加到production.rb

config.assets.precompile += %w( active_admin.css active_admin.js active_admin/print.css)

答案 4 :(得分:0)

当我忘记运行$ heroku run rake db:migrate时,我得到了非常相似的错误消息。我创建了一个新的Family模型,并将应用程序的根目录设置为开发中的一个系列#show页面。我得到了与部署到Heroku时相同的神秘错误消息,并且能够通过在生产数据库中运行迁移并在控制台中创建Family对象来解决它。

相关问题