leshank leshank - 7 months ago 61
Ruby Question

uninitialized constant ActionView::Helpers::ActiveModelHelper (NameError)

Having problem getting Redmine working on Centos 7 with Passenger.

The redmine install all went ok I'm getting the following error (in browser):

uninitialized constant ActionView::Helpers::ActiveModelHelper (NameError)
/home/redmine/.rvm/gems/ruby-2.3.0/gems/actionview-4.2.5/lib/action_view/helpers.rb:40:in `<module:Helpers>'
/home/redmine/.rvm/gems/ruby-2.3.0/gems/actionview-4.2.5/lib/action_view/helpers.rb:4:in `<module:ActionView>'
/home/redmine/.rvm/gems/ruby-2.3.0/gems/actionview-4.2.5/lib/action_view/helpers.rb:3:in `<top (required)>'
/home/redmine/.rvm/gems/ruby-2.3.0/gems/actionview-4.2.5/lib/action_view/base.rb:5:in `<top (required)>'
/home/redmine/.rvm/gems/ruby-2.3.0/gems/actionview-4.2.5/lib/action_view/view_paths.rb:1:in `<top (required)>'
/home/redmine/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.5/lib/abstract_controller/rendering.rb:4:in `<top (required)>'
/home/redmine/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.5/lib/action_controller/base.rb:204:in `<class:Base>'
/home/redmine/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.5/lib/action_controller/base.rb:164:in `<module:ActionController>'
/home/redmine/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.5/lib/action_controller/base.rb:5:in `<top (required)>'
/home/redmine/.rvm/gems/ruby-2.3.0/gems/actionpack-action_caching-1.1.1/lib/action_controller/action_caching.rb:13:in `<top (required)>'
/home/redmine/.rvm/gems/ruby-2.3.0/gems/actionpack-action_caching-1.1.1/lib/actionpack/action_caching.rb:1:in `require'
/home/redmine/.rvm/gems/ruby-2.3.0/gems/actionpack-action_caching-1.1.1/lib/actionpack/action_caching.rb:1:in `<top (required)>'
/home/redmine/.rvm/gems/ruby-2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:91:in `require'
/home/redmine/.rvm/gems/ruby-2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:91:in `rescue in block in require'
/home/redmine/.rvm/gems/ruby-2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:68:in `block in require'
/home/redmine/.rvm/gems/ruby-2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
/home/redmine/.rvm/gems/ruby-2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
/home/redmine/.rvm/gems/ruby-2.3.0/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
/home/redmine/redmine/config/application.rb:5:in `<top (required)>'
/home/redmine/redmine/config/environment.rb:2:in `require'
/home/redmine/redmine/config/environment.rb:2:in `<top (required)>'
config.ru:3:in `require'
config.ru:3:in `block in <main>'
/home/redmine/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
/home/redmine/.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/home/tracks/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/passenger-5.0.26/src/helper-scripts/rack-preloader.rb:110:in `eval'
/home/tracks/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/passenger-5.0.26/src/helper-scripts/rack-preloader.rb:110:in `preload_app'
/home/tracks/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/passenger-5.0.26/src/helper-scripts/rack-preloader.rb:156:in `<module:App>'
/home/tracks/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/passenger-5.0.26/src/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
/home/tracks/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/passenger-5.0.26/src/helper-scripts/rack-preloader.rb:29:in `<main>'


Any suggestions on what to try are most welcome.

Note: I've updated nokogiri so issue isn't there.

Answer

This was solved by adding to the VirtualHost for the site:

PassengerBaseURI /home/user/redmineapp
PassengerRuby /home/user/.rvm/wrappers/ruby-2.3.0/ruby