browsermedia/bcms_mobile — Issue #2: Server Error
Author: jefffis
Created: 2012-02-13 20:22:44+00:00
State: open

After installing this module, when you try to run it the project locally, unless you are logged into the CMS, you receive a generic server error rendered out. The stack trace of this is as follows:

Exception: undefined method `browsercms_cache_directory' for #
/Users/jdoan/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.9/lib/rails/railtie/configuration.rb:77:in `method_missing'
/Users/jdoan/.rvm/gems/ruby-1.9.2-p290/gems/bcms_mobile-1.0.0/lib/bcms_mobile/mobile_aware.rb:40:in `cms_cache_directory'
/Users/jdoan/.rvm/gems/ruby-1.9.2-p290/gems/bcms_mobile-1.0.0/lib/bcms_mobile/engine.rb:36:in `configure_cache_directory'
/Users/jdoan/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.9/lib/active_support/callbacks.rb:462:in `_run__299973198460822490__process_action__3273094018654080844__callbacks'

To get around this, simply add the following to the development.rb file in /environments

config.bcms_mobile_cache_directory = File.join(Rails.root, 'public', 'cache' 'mobile')
config.browsercms_cache_directory = File.join(Rails.root, 'public', 'cache', 'full')

Just like in the production.rb file. Once this is added, and you restart the app, it works fine.