This project is archived and is in readonly mode.

#5850 ✓committed
Igor Galeta

ActiveSupport::Cache::FileStore: undefined method `ord' for nil:NilClass

Reported by Igor Galeta | October 21st, 2010 @ 12:49 PM | in 3.0.2

undefined method ord' for nil:NilClass

This issue raise in rails 3.0.0 and rails 3.0.1, when I using file_store for cache_store.

 config.action_controller.cache_store = ActiveSupport::Cache::FileStore.new(Rails.root.join("tmp", "cache").to_s)

My fix:

  module ActiveSupport
    module Cache
      class FileStore < Store

      private

        # Translate a file path into a key.
        def file_path_key(path)
          fname = path[cache_path.size, path.size].split(File::SEPARATOR, 4).last
          fname.gsub(UNESCAPE_FILENAME_CHARS){|match| [match.delete('%')].pack('H*') }
        end
      end
    end
  end

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>