grosser/gettext_i18n_rails_example — Issue #2: Cannot start example application (errors and solutions)
Author: vlewin
Created: 2011-10-26 09:07:02+00:00
State: open

I use ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux] installed in rvm and Rails 3.1.0

I tried to start example application but got couple of errors. This summary is just a help for the people who have the same problems.

Errors and solutions:

Error: invalid multibyte char (US-ASCII)
Solution: add magic comment "# coding: utf-8" at the beginning of countries_and_languages.rb

Error: "ActiveRecord::StatementInvalid (Could not find table 'cars'): app/controllers/cars_controller.rb:5:in 'index'"
Solution: "rake db:migrate"

Error: "You have already activated rake 0.9.2.2, but your Gemfile requires rake 0.9.2. Using bundle exec may solve this."
Solution:
- add gem 'rake', '0.9.2.2' to Gemfile
- bundle update rake

Error: "undefined method `load_tasks' for Rails::Application:Class"
Solution:

- replace Rails::Application.load_tasks with GettextExampleRails::Application.load_tasks
- add following code to Rakefile:

module ::GettextExampleRails
class Application
include Rake::DSL
end
end

module ::RakeFileUtils
extend Rake::FileUtilsExt
end