I have been working on extending Rails’ I18n Simple backend to make it work with Serbian grammar (post on that will follow soon), but I kept getting an error:

Expected ./lib/serbian_simple.rb to define SerbianSimple (LoadError)

I’ve just spent an hour trying to figure out why this keeps happening and I found that there’s a lot of people with similar problem.

It seems that the problem appears when Rails tries to autoload files. In my case there was a simple solution – I just added require ‘serbian_simple.rb’ in environment.rb to manually load the file.

Share Article:

Share Article:

This site is registered on wpml.org as a development site. Switch to a production site key to remove this banner.