Reputation: 80265
Following a tutorial I have successfully made a simple RoR app locally (using SQLite and some very simple data model), and synching with heroku via git works. (Heroku server starts and displays the usual welcome page.)
However, if I want to access one of my class urls, like /users
, I get this message:
Internal Server Error
undefined method `info' for nil:NilClass
heroku logs
reveals
ERROR NoMethodError: undefined method `info' for nil:NilClass
/app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.7/lib/action_dispatch/middleware/request_id.rb:22:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.3/lib/rack/runtime.rb:17:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.7/lib/rails/rack/logger.rb:25:in `call_app'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.7/lib/rails/rack/logger.rb:16:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.7/lib/rails/applicatio
n.rb:220:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.7/lib/rails/rack/log_tailer.rb:17:in `call'
/usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.3/lib/rack/methodoverride.rb:21:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.3/lib/rack/lock.rb:15:in `call'
/usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.7/lib/action_dispatch/middleware/static.rb:62:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.3/lib/rack/content_length.rb:14:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.3/lib/rack/handler/webrick.rb:59:in `service'
/usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.7/lib/rails/engine.rb:479:in `call'
heroku[router]: at=info method=GET path=/users host=xxx.herokuapp.com fwd=178.190.207.99 dyno=web.1 queue=0 wait=0ms connect=0ms service=12ms status=500 bytes=340
It seems to have something to do with the part in the request at=info
. My research up to now seems to indicate a connection to ActiveRecord:Base.logger
but I do not understand it.
Where do I even start to look for the reason for this?
In other posts, the Gemfile was also relevant, so here it is:
source 'https://rubygems.org'
gem 'rails', '3.2.7'
group :development do
gem 'sqlite3', '1.3.7'
end
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
Upvotes: 2
Views: 1236
Reputation: 508
add this:
config.active_record.logger=Logger.new(STDOUT)
to config/environment/xxx.rb. xxx is the name of the environment you are working on, it should be development, production or test.
Upvotes: 0
Reputation: 3766
Run the following (if you haven't already):
heroku run rake db:migrate
What does your UsersController look like?
What's the output of rake routes
?
Upvotes: 1