undefined method `lang' for nil:NilClass #84

masukomi opened this Issue Sep 1, 2012 · 3 comments

2 participants


NoMethodError (undefined method lang' for nil:NilClass):

Create a new, empty database.
Point Typo at it in dev mode.
Start up the rails server.
Go to http://localhost:3000

Migrations will run until eventually you see this:

Migrating to RemoveNotificationsTable (105)
   (1.4ms)  DROP TABLE `notifications`
   (0.8ms)  INSERT INTO `schema_migrations` (`version`) VALUES ('105')
  Blog Load (0.2ms)  SELECT `blogs`.* FROM `blogs` ORDER BY id LIMIT 1
Completed 500 Internal Server Error in 11282ms

NoMethodError (undefined method `lang' for nil:NilClass):
  app/controllers/application_controller.rb:40:in `load_lang'
publify member

that worked.

While fixing the problem is obviously the optimal solution I don't see a reason why it should preclude updating the documentation until it's fixed.

@fdv fdv was assigned Dec 27, 2012
@fdv fdv added a commit that referenced this issue Dec 27, 2012
@fdv fdv Since we don't want Typo users to mess with command line, we have alw…
…ays setup the blog model and initial data when trying to reach it at first load from the browser. Since we moved the initial schema generation to schema.rb and initial data to seed.rb, this didn't work anymore.

This commit adds a call to rake db:seed when loading the initial schema and moves the initial page creation into the setup controller after creating the first user. For some reasons, I need to force the User, Page and Article model reload before creating anything.

Not sure how I can test this.

This solves issue #84.
publify member
fdv commented Jan 9, 2013

This bug has been fixed in Typo 6.1.1. We encourage you to update your Typo version to the latest stable to profit from that fix.

@fdv fdv closed this Jan 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment