之前我曾经使用过rails 2.3.2然后我决定升级到2.3.4版本。
今天我尝试生成迁移(我可以使用2.3.2版本完成此操作)并且收到以下错误消息:
C:/Program Files (x86)/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:812:in `const_missing': uninitialized constant ActiveSupport (NameError)
from D:/Proyectos/Cursometro/www/config/environment.rb:33
from C:/Program Files (x86)/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:111:in `run'
from D:/Proyectos/Cursometro/www/config/environment.rb:15
from D:/Proyectos/Cursometro/www/config/environment.rb:31:in `require'
from C:/Program Files (x86)/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from C:/Program Files (x86)/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/commands/generate.rb:1
from C:/Program Files (x86)/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/commands/generate.rb:31:in `require'
from C:/Program Files (x86)/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from script\generate:3
我不知道为什么会这样。在2.3.2中一切正常,现在却没有。
答案 0 :(得分:1)
您的计算机上未安装Activesupport gem。尝试运行此命令:
gem install activesupport
如果它不起作用,试试这个
gem update --system
gem update --source http://gems.rubyonrails.org
答案 1 :(得分:0)
我可以通过在Rails::Initializer.run do |config|
块结束后放置以下行(如下所示)来解决这个问题(之前它在此块之内)。
ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(:standard => "%B %d, %Y")