这与我在这里列出的其他问题有关,但这些解决方案对我不起作用,所以我创建了一个新的rails应用程序,但是我得到了同样的错误,我已在下面列出。
Started GET "/" for ::1 at 2015-08-29 16:26:01 -0400
NameError (uninitialized constant ActiveModel::Validations::PresenceValidator):
activerecord (4.2.4.rc1) lib/active_record/validations/presence.rb:3:in `<module:Validations>'
activerecord (4.2.4.rc1) lib/active_record/validations/presence.rb:2:in `<module:ActiveRecord>'
activerecord (4.2.4.rc1) lib/active_record/validations/presence.rb:1:in `<top (required)>'
activerecord (4.2.4.rc1) lib/active_record/validations.rb:90:in `<top (required)>'
activerecord (4.2.4.rc1) lib/active_record/base.rb:294:in `<class:Base>'
activerecord (4.2.4.rc1) lib/active_record/base.rb:269:in `<module:ActiveRecord>'
activerecord (4.2.4.rc1) lib/active_record/base.rb:26:in `<top (required)>'
activerecord (4.2.4.rc1) lib/active_record/migration.rb:383:in `connection'
activerecord (4.2.4.rc1) lib/active_record/migration.rb:370:in `call'
actionpack (4.2.4.rc1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.4.rc1) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
activesupport (4.2.4.rc1) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
activesupport (4.2.4.rc1) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.4.rc1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.4.rc1) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.4.rc1) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.4.rc1) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
web-console (2.2.1) lib/web_console/middleware.rb:39:in `call'
actionpack (4.2.4.rc1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.4.rc1) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.4.rc1) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.4.rc1) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.4.rc1) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.4.rc1) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.4.rc1) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.4.rc1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.4) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.4.rc1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
actionpack (4.2.4.rc1) lib/action_dispatch/middleware/static.rb:116:in `call'
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
railties (4.2.4.rc1) lib/rails/engine.rb:518:in `call'
railties (4.2.4.rc1) lib/rails/application.rb:165:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
rack (1.6.4) lib/rack/content_length.rb:15:in `call'
rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'
这是Gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.4.rc1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# 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]
#
gem 'brakeman', '~> 3.0.5'
gem 'dawnscanner', '~> 1.3.5'
gem 'activemodel', '~> 4.2.3'
对我来说,将我网站上的所有文件重新生成到新应用程序是最后的手段,但我不确定为什么会出现这个新项目。我唯一做的就是安装两颗宝石来帮助我安全,所以也许就是这样,但我不确定。有人可以帮忙吗?
答案 0 :(得分:0)
我想我弄明白了这个问题。我做了一个新的应用程序,没有两个宝石,它工作。我去了我的应用程序并取出了一个宝石(dawnscanner
)并且它有效。