需要'active_support / inflector / inflections'时MissingSourceFile

时间:2011-01-27 11:04:33

标签: ruby bundler activesupport

我最近更新了我的应用程序以使用Bundler,但我遇到了一些麻烦。我正在使用依赖于activesupport 2.3+的gem而我无法使用Bundler。尝试加载我的应用程序时乘客崩溃。尝试加载MissingSourceFile时发生activesupport错误。有谁知道如何解决这个问题或者我可能做错了什么? activesupport 3.0+不会发生这种情况,但我使用的宝石依赖于2.x

no such file to load -- active_support/inflector/inflections (MissingSourceFile)

0   /opt/ruby/1.8.7-ee-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.3.10/lib/active_support/dependencies.rb   182 in `require'
1   /opt/ruby/1.8.7-ee-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.3.10/lib/active_support/dependencies.rb   182 in `require'
2   /opt/ruby/1.8.7-ee-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.3.10/lib/active_support/dependencies.rb   547 in `new_constants_in'
3   /opt/ruby/1.8.7-ee-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.3.10/lib/active_support/dependencies.rb   182 in `require'
4   /opt/ruby/1.8.7-ee-2010.02/lib/ruby/gems/1.8/gems/roxml-3.1.6/lib/roxml.rb  4   
.
.
.
9   config.ru   8   in `require'

3 个答案:

答案 0 :(得分:0)

要求这样的变形是ActiveSupport 3样式。如你所见,

activesupport-2.3.9 $ find . -name "inflections.rb"
./lib/active_support/core_ext/integer/inflections.rb
./lib/active_support/core_ext/string/inflections.rb
./lib/active_support/inflections.rb

如果可能,违规宝石应该做类似的事情:

require 'active_support'
require 'active_support/version'
if ActiveSupport::VERSION::MAJOR == 3
  require 'active_support/inflector/inflections'
end

这就是the remote_table gem的作用。

答案 1 :(得分:0)

如果您使用的是roxml gem,请切换到3.1.3版本。

答案 2 :(得分:0)

我正在使用sudo运行,它运行正常!

检查文件夹环境的权限:

ENV['X_DEBIAN_SITEID'] ||= 'default'
ENV['RAILS_ETC'] ||= "/etc/redmine/#{ENV['X_DEBIAN_SITEID']}"
ENV['RAILS_LOG'] ||= "/var/log/redmine/#{ENV['X_DEBIAN_SITEID']}"
ENV['RAILS_VAR'] ||= "/var/lib/redmine/#{ENV['X_DEBIAN_SITEID']}"
ENV['RAILS_CACHE'] ||= "/var/cache/redmine/#{ENV['X_DEBIAN_SITEID']}"
ENV['SCHEMA'] ||= "#{ENV['RAILS_CACHE']}/schema.db"