Posts tagged “Rails”

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.

http://answers.candoerz.com/question/164246/integrating-refinerycms-into-an-existing-rails-application.aspx

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

How to Make Docker Images Smaller: Ruby and Rails Images

By richardtylee.

As I stated earlier, we are primarily a Ruby on Rails organization.  As such, there are plenty of ruby and rails community-supported docker images available to used as base images.

We took a look at some of the ruby and rails images we use. All these images are debian based. Even amongst minor versions, we found large differences in size. In general (though not always the case), the latest minor version will be the smallest size. Since minor versions are backwards compatible, we should be on the latest minor version. It is a good idea to standardize the ruby and rails version we use for our services. Unless there's a specific reason to deviate, we should sit to one version for consistency.

Below is are some of the versions I was able to download and their sizes: