在openshift上部署时,未初始化的常量ActionView :: Helpers :: ActiveModelHelper

时间:2015-01-19 09:57:10

标签: ruby-on-rails openshift

我正在尝试在openshift上部署我的rails应用程序,但是我得到了这个错误。 Phusion Passenger显示此错误:     您已经激活了机架1.5.2,但您的Gemfile需要机架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/

3 个答案:

答案 0 :(得分:0)

actionpack 4.2需要rack~&gt; 1.6.0。您的Gemfile可能不包含rack gem。您可以尝试将此行添加到您的Gemfile

gem 'rack', '~> 1.6.0'

然后运行

bundle install  

git push origin

这可能会迫使openshift环境使用最新的机架宝石。

答案 1 :(得分:0)

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

答案 2 :(得分:0)

作为一个开始的疑难解答步骤重命名Gemfile.lock(或删除它),然后重新安装您的包bundle install