Search code examples
rubyruby-on-rails-3rails-3-upgrade

environment.rb contents when migrating from Rails 2 to Rails 3


I'm updating an application from rails 2.3 to rails 3.1, and I'm new to rails. I followed the RailsCast and got some idea. Somebody please help me for where to place my old environment variables. These are the four pieces of code in my old environment.rb

1:

ENV['RAILS_ENV'] ||= 'development' 

2:

if RUBY_PLATFORM =~ /java/
  require 'rubygems'
  RAILS_CONNECTION_ADAPTERS = %w(jdbc)
end

3:

CalendarDateSelect.format = :hyphen_ampm

4:

Mime::Type.register "text/csv", :csv

Where do I place this, the new environment.rb or application.rb?


Solution

  • I figure out the answer, all the configurations must go to the application.rb