【问题标题】:uninitialized constant ActionView::Helpers::ActiveModelHelper when deploying on openshift在 openshift 上部署时未初始化的常量 ActionView::Helpers::ActiveModelHelper
【发布时间】:2015-03-17 07:08:18
【问题描述】:

我正在尝试在 openshift 上部署我的 rails 应用程序,但出现此错误。 Phusion 乘客显示此错误: 你已经激活了 rack 1.5.2,但是你的 Gemfile 需要 rack 1.6.0。使用 bundle exec 可以解决这个问题。 (Gem::LoadError)

remote: uninitialized constant ActionView::Helpers::ActiveModelHelper
remote: /var/lib/openshift/54bc0eee5973ca3f54000153/app-root/runtime/repo/vendor
/bundle/ruby/gems/actionview-4.2.0/lib/action_view/helpers.rb:40:in `<module:Helpers>'
remote: /var/lib/openshift/54bc0eee5973ca3f54000153/app- root/runtime/repo/vendor
/bundle/ruby/gems/actionview-4.2.0/lib/action_view/helpers.rb:4:in `<module:ActionView>'
remote: /var/lib/openshift/54bc0eee5973ca3f54000153/app-root/runtime/repo/vendor
/bundle/ruby/gems/actionview-4.2.0/lib/action_view/helpers.rb:3:in `<top (required)>'
remote: /var/lib/openshift/54bc0eee5973ca3f54000153/app-root/runtime/repo/vendor
/bundle/ruby/gems/actionview-4.2.0/lib/action_view/base.rb:5:in `<top (required)>'
remote: /var/lib/openshift/54bc0eee5973ca3f54000153/app-root/runtime/repo/vendor
/bundle/ruby/gems/actionview-4.2.0/lib/action_view/view_paths.rb:1:in `<top (required)>'
remote: /var/lib/openshift/54bc0eee5973ca3f54000153/app-root/runtime/repo/vendor
/bundle/ruby/gems/actionpack-4.2.0/lib/abstract_controller/rendering.rb:4:in `<top (required)>'
remote: /var/lib/openshift/54bc0eee5973ca3f54000153/app-root/runtime/repo/vendor
/bundle/ruby/gems/actionpack-4.2.0/lib/action_controller/base.rb:204:in `<class:Base>'
remote: /var/lib/openshift/54bc0eee5973ca3f54000153/app-root/runtime/repo/vendor
/bundle/ruby/gems/actionpack-4.2.0/lib/action_controller/base.rb:164:in `<module:ActionController>'
remote: /var/lib/openshift/54bc0eee5973ca3f54000153/app-root/runtime/repo/vendor
/bundle/ruby/gems/actionpack-4.2.0/lib/action_controller/base.rb:5:in `<top (required)>'
remote: /var/lib/openshift/54bc0eee5973ca3f54000153/app-root/runtime/repo/vendor
/bundle/ruby/gems/responders-2.0.2/lib/responders/controller_method.rb:37:in `<top (required)>'
remote: /var/lib/openshift/54bc0eee5973ca3f54000153/app-root/runtime/repo/vendor
/bundle/ruby/gems/responders-2.0.2/lib/responders.rb:15:in `<module:Responders>'
remote: /var/lib/openshift/54bc0eee5973ca3f54000153/app-root/runtime/repo/vendor
/bundle/ruby/gems/responders-2.0.2/lib/responders.rb:9:in `<top (required)>'
remote: /var/lib/openshift/54bc0eee5973ca3f54000153/app-root/runtime/repo/vendor
/bundle/ruby/gems/devise-3.4.1/lib/devise.rb:7:in `<top (required)>'
remote: /opt/rh/ror40/root/usr/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
remote: /opt/rh/ror40/root/usr/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
remote: /opt/rh/ror40/root/usr/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
remote: /opt/rh/ror40/root/usr/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
remote: /opt/rh/ror40/root/usr/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
remote: /opt/rh/ror40/root/usr/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
 remote: /opt/rh/ror40/root/usr/share/gems/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
 remote: /var/lib/openshift/54bc0eee5973ca3f54000153/app-root/runtime/repo/config/application.rb:9:in `<top (required)>'
 remote: /var/lib/openshift/54bc0eee5973ca3f54000153/app-root/runtime/repo/Rakefile:4:in `require'
remote: /var/lib/openshift/54bc0eee5973ca3f54000153/app-root/runtime/repo/Rakefile:4:in `<top (required)>'
remote: (See full trace by running task with --trace)
remote: Compilation of assets is disabled or assets not detected.
remote: Starting Ruby cartridge
remote: -------------------------
remote: Git Post-Receive Result: success
remote: Activation status: success
remote: Deployment completed with status: success
To ssh://54bc0eee5973ca3f54000153@livechat-rdemidovapps.rhcloud.com/~/git/livechat.git/

【问题讨论】:

标签: ruby-on-rails openshift


【解决方案1】:

actionpack 4.2 需要机架 ~> 1.6.0。您的 Gemfile 可能不包含 rack gem。您可以尝试将此行添加到您的 Gemfile 中

gem 'rack', '~> 1.6.0'

然后运行

bundle install  

git push origin

这可能会强制 openshift 环境使用最新的 rack gem。

【讨论】:

  • 看来 openshift ruby​​ 墨盒不支持 rails 4.2。 rails 4.1 可以正常工作。这是因为从您的日志中可以看出机架不兼容。 Openshift 已经激活了 rack 1.5.2,而 rails 4.2。机架需要最低版本 1.6.0。
【解决方案2】:

OpenShift 在内部依赖于 RHEL 6.6 SCL ror40,其中包括机架版本 1.5.2 和乘客 4.0.18。不幸的是,这些都不能像今天一样更新。

【讨论】:

    【解决方案3】:

    作为开始的故障排除步骤,重命名 Gemfile.lock(或删除它),然后重新安装您的捆绑包bundle install

    【讨论】:

      猜你喜欢
      • 2015-12-29
      • 2016-02-27
      • 1970-01-01
      • 2012-04-29
      • 2023-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多