Can';t在ruby 2.1.5中加载'active_support/core_ext'

Can';t在ruby 2.1.5中加载'active_support/core_ext',ruby,Ruby,当我需要“活动\u支持/core\u ext”时,会出现错误: NameError: uninitialized constant ActiveSupport::Autoload from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/number_helper.rb:3:in `<module:NumberHelper>' 我是否应该安装一些其他g

当我
需要“活动\u支持/core\u ext”
时,会出现错误:

NameError: uninitialized constant ActiveSupport::Autoload from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/number_helper.rb:3:in `<module:NumberHelper>'
我是否应该安装一些其他gems来使用
active\u support/core\u ext


我在Ubuntu14.04中使用了ruby 2.1.5p273。

假设您使用的是bundler,请尝试此诊断代码以查看其效果:

require 'rubygems'        # You may be able to omit this line
require 'bundler/setup'   # You may be able to omit this line
require 'active_support'
require 'active_support/core_ext' 
较新的Ruby版本可以跳过
rubygems
设置
,和
核心扩展
,只需使用以下命令:

require 'active_support'

谢谢实际上,
require'active\u support'
是我在
require'active\u support/core\u ext
之前所需要的全部。顺便说一句,我可能需要
主动\u支持/core\u ext
,而不需要
主动\u支持
。这是最近改变的吗?据我所知,使用require core_ext(单独使用)已经被弃用了,我想你会看到它现在已经被淘汰了。
require 'active_support'