Question

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?

Was it helpful?

Solution 4

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

OTHER TIPS

3 and 4 in an initializer (config/initializers), i don't think you need 1, and i am not sure about 2, but i think you just need to add gem 'activerecord-jdbc-adapter' to your Gemfile. ( i haven't used jruby with rails yet, so i honestly don't know, it's just a guess, because i saw it somewhere )

Don't upgrade. People may not like that answer, but it's not worth the effort to go from 2.3 to 3. Starting from scratch? Maybe use 3, up to you.

This tutorial helped me do what you are trying to do: http://gregmoreno.ca/rails-3-upgrade-part-1-booting-the-application/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top