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-
我的問題在Ruby和Rails中很常見。雖然我經歷了不同的stackoverflow答案,但我找不到任何具體的問題來解決我的錯誤。actionview-4.2.4 - 未初始化的常量ActionView :: Helpers :: ActiveModelHelper(NameError)
我試着重新安裝較低版本的鐵軌寶石,但同樣的錯誤不斷彈出。我試圖重新安裝所有拋出錯誤的寶石,但問題仍然沒有消失。許多文章指出這是一個兼容性問題。但是當我嘗試重新安裝railties gem(4.0.0)的較低版本時,命令提示仍然要求我升級到最新版本才能繼續。我還安裝了'乘客'網絡服務器來檢查兼容性和類似的錯誤彈出,但這次與乘客寶石。請相應地調查一下。我也在複製下面的寶石文件。
# 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 https://github.com/rails/execjs#readme 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: https://github.com/rails/turbolinks
#gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
#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]
@K中號Rakibul伊斯蘭 - 我想這一點。但我得到的問題是命令提示符不允許我運行rails,直到我將其升級到最新版本的4.2.2。我正在粘貼下面的代碼片段。 C:\ Users \ Clarion Smith \ Documents \ Sites \ simple_cms> rails server 無法在任何源中找到railties-4.2.4 運行'bundle install'安裝缺失的gem。我運行軟件包安裝,並更新到4.2.4(最新版本自動)。 –
嗯,好像事情已經改變了。你能分享你正在關注的教程鏈接嗎? –
https://www.youtube.com/watch?v=WEjkWRbLS84&index=4&list=PL5bVh07ELMxT8OsaX01SjpqmsWCk-eHtp –