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 –