12.03.2015 Autor Mike 64 249

In production mode there is a problem if you have  enabled threadsafe mode.
 
To activate  threadsafe mode you need to uncomment this line in config/environments/production.rb# Enable threaded mode
config.threadsafe! 
After that add this line to fix migration problems in production mode:
 
# Allow rake tasks to autoload models in thread safe mode, more info at http://stackoverflow.com/a/4880253
config.dependencyloading = true if $railsraketask
 
 
I also have set config.autoload
paths which does not work with JRuby (found here). You have to add this code after the autoload statement in your config/application.rb
 # when threadsafe is enabled (i.e. JRuby max runtimes 1 does this) then classes/modules
# in lib needs to loaded through some mechanism other than autoloadpaths
config.autoload
paths.each do |path|
config.eagerloadpaths << path
endThe only other way seems to be to explicitly require those files.