Today, I created a copy of a working app, which runs perfectly on Heroku, and tried to deploy it on Heroku as a starting point for a new project.
I added the new fol
I found this, much easier solution:
Just add ENV['RUBYOPT'] = "-Ku"
to your environment variables on Heroku. You can do this with figaro gem:
gem "figaro"
to your Gemfile
bundle install
Insert this code in config/application.yml
:
production:
RUBYOPT: "-Ku"
Run rake figaro:heroku
Also, you can try with magic_encoding gem, but I dislike this approach.
In your config/application.rb,
config.encoding = "utf-8"
in the database.yml,
development:
adapter: mysql2(whatever your db)
host: localhost
encoding: utf8
you also have to add(including the hash)
# encoding: UTF-8
source:http://craiccomputing.blogspot.com/2011/02/rails-utf-8-and-heroku.html