mercredi 30 septembre 2015

actionview-4.2.4 - uninitialized constant ActionView::Helpers::ActiveModelHelper (NameError)

C:\Users\Clarion Smith\Documents\Sites\simple_cms>rails server
C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionview-4.2.4/lib/action_view/helpers.rb:40:in `<module:Helpers>': uninitialized constant ActionView::Helpers::ActiveModelHelper (NameError)
        from C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionview-4.2.4/lib/action_view/helpers.rb:4:in `<module:ActionView>'
        from C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionview-4.2.4/lib/action_view/helpers.rb:3:in `<top (required)>'
        from C:/Ruby22/lib/ruby/gems/2.2.0/gems/actionview-

My problem is very common in Ruby and Rails. Though I went through different stackoverflow answers, I could not find anything specific which would fix my error.

I tried reinstalling lower version of the railites gem but the same error keeps popping. I tried reinstalling all the gems that were throwing errors and still the problem doesnt seem to go away. Many articles indicated that this is a compatibility issue. But when I tried reinstalling a lower version of the railties gem(4.0.0), the command prompt still asked me to upgrade to the latest version in order to continue. I also installed 'Passenger' web server to check the compatibility and a similar error popped up but this time with the passenger gem. Please look into this accordingly. I am also copying below the gem file.

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.4'
# Use mysql as the database for Active Record
gem 'mysql2'
#Bundle for Passenge r web server
gem 'passenger'
# Use SCSS for stylesheets
#gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets

#gem 'uglifier', '>= 1.3.0'
gem 'rack', '~> 1.6.0'
gem 'rspec-rails', :group => [:development, :test]
# Use CoffeeScript for .coffee assets and views

#gem 'coffee-rails', '~> 4.1.0'
# See http://ift.tt/1D4cmMg for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library

#gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: http://ift.tt/OVlBaz

#gem 'turbolinks'
# Build JSON APIs with ease. Read more: http://ift.tt/GXyveo

#gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.

#gem 'sdoc', '~> 0.4.0', group: :doc

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug'
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Aucun commentaire:

Enregistrer un commentaire