Search code examples
ruby-on-rails-3character-encodingrubygemsbundlerredgreen

How to disable gem temporarily in Rails 3 using Bundler?


I have discovered that the redgreen gem is incompatible with ISO-8859-1 encoding of test files. What is the best way to disable one gem temporarily to run certain test files?


Solution

  • My first advice would be to save those files in UTF-8.

    Alternatively, I'd look into the grouping feature of Bundler.

    In your Gemfile

    group :utf8 do
      gem 'redgreen'
    end
    

    And then require that group only when you want to use the redgreen gem.

    Bundler.require(:utf8, :default, Rails.env)