refinerycms: NoMethodError: undefined method `prepend_path' for nil:NilClass

By richardtylee

While setting up refinerycms recently, I kept running into the following error:

speakingurl-rails.rb:8:in `block in <class:Railtie>': undefined method `prepend_path' for nil:NilClass (NoMethodError)

This happened both when creating a new application and integrating refinerycms into an existing application.  It occurred when running rails generate refinery:cms and other rake tasks like rake db:migrate. After some searching, I came across this explanation.

What happened was the latest version of sprocket-rails has be published in rubygems.  speakingurl-rails, which is dependency for slug support, has not yet been updated to support the new sprocket-rails gem.  To resolve this, I had to:

  1. In Gemfile, add gem 'sprockets-rails', '~> 2.3.3'
  2. Run: bundle update