需要“active_support/inflector/inflections”时缺少SourceFile

发布于 2024-10-14 20:28:41 字数 1055 浏览 3 评论 0原文

我最近更新了我的应用程序以使用 Bundler,但遇到了一些麻烦。我使用的 gem 依赖于 activesupport 2.3+,但我无法让它与 Bundler 一起使用。 Passenger 在尝试加载我的应用程序时崩溃。尝试加载 activesupport 时发生 MissingSourceFile 错误。有谁知道如何解决这个问题或者我可能做错了什么? activesupport 3.0+ 不会发生这种情况,但我使用的 gem 依赖于 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'

I recently updated my application to use Bundler, but I'm having some troubles. I'm using a gem that depends on activesupport 2.3+ and I can't get it to work with Bundler. Passenger crashes while trying to load my application. A MissingSourceFile error occurs while it tries to load activesupport. Does anybody know how to solve this issue or what I might do wrong? It doesn't happen with activesupport 3.0+, but the gem I'm using relies on 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'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

绅刃 2024-10-21 20:28:41

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

如果可能的话,有问题的 gem 应该做类似的事情:

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

这就是 remote_table gem 可以。

Requiring inflections like that is the ActiveSupport 3 style. As you can see,

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

If possible, the offending gem should do something like:

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

That's what the remote_table gem does.

遇见了你 2024-10-21 20:28:41

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

If you are using roxml gem, switch to 3.1.3 version.

清风不识月 2024-10-21 20:28:41

我用 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"

I was running with sudo and it works fine!

Check the permissions of the folders enviroment:

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"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文