sqlite3 load error while start rails5 server - ruby-on-rails

I'v install ruby version 2.3.1p112 with ruby devkit on windows 10 64bit using ruby installer and rails 5 then run command:
rails new app
I'v got my new app directory then I cd in it then run
bundle install
rails s
but I'v got this error:
LoadError (Could not load 'active_record/connection_adapters/sqlite3_adapter'.
Make sure that the adapter in config/database.yml is valid.
If you use an adapter other than 'mysql2', 'postgresql' or 'sqlite3'
add the necessary adapter gem to the Gemfile.):
I'v edit sqlite3-1.3.11-x86-mingw32.gemspec file in line 10 from this:
s.require_paths = ["lib"]
to this:
s.require_paths = ["lib/sqlite3_native"]
but the same error appear.
datebase.yml:
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: sqlite3
pool: 5
timeout: 5000
development:
<<: *default
database: db/development.sqlite3
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: db/test.sqlite3
production:
<<: *default
database: db/production.sqlite3
This is my Gemfile:
source 'https://rubygems.org'
# Use credit_debit_card_number_validator to validate and generate card numbers
gem 'credit_debit_card_number_validator'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
# Use Puma as the app server
gem 'puma', '~> 3.0'
# 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.2'
# 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 navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# 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', platform: :mri
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
and this is Application trace:
This error occurred while loading the following files:
active_record/base
finally this is Framework trace:
activesupport (5.0.0.1) lib/active_support/dependencies.rb:293:in `require'
activesupport (5.0.0.1) lib/active_support/dependencies.rb:293:in `block in require'
activesupport (5.0.0.1) lib/active_support/dependencies.rb:259:in `load_dependency'
activesupport (5.0.0.1) lib/active_support/dependencies.rb:293:in `require'
activerecord (5.0.0.1) lib/active_record/connection_adapters/sqlite3_adapter.rb:8:in `<top (required)>'
activesupport (5.0.0.1) lib/active_support/dependencies.rb:293:in `require'
activesupport (5.0.0.1) lib/active_support/dependencies.rb:293:in `block in require'
activesupport (5.0.0.1) lib/active_support/dependencies.rb:259:in `load_dependency'
activesupport (5.0.0.1) lib/active_support/dependencies.rb:293:in `require'
activerecord (5.0.0.1) lib/active_record/connection_adapters/connection_specification.rb:174:in `spec'
activerecord (5.0.0.1) lib/active_record/connection_handling.rb:53:in `establish_connection'
activerecord (5.0.0.1) lib/active_record/railtie.rb:125:in `block (2 levels) in <class:Railtie>'
activesupport (5.0.0.1) lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
activesupport (5.0.0.1) lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
activesupport (5.0.0.1) lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
activesupport (5.0.0.1) lib/active_support/lazy_load_hooks.rb:44:in `each'
activesupport (5.0.0.1) lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
activerecord (5.0.0.1) lib/active_record/base.rb:324:in `<module:ActiveRecord>'
activerecord (5.0.0.1) lib/active_record/base.rb:24:in `<top (required)>'
activesupport (5.0.0.1) lib/active_support/dependencies.rb:293:in `require'
activesupport (5.0.0.1) lib/active_support/dependencies.rb:293:in `block in require'
activesupport (5.0.0.1) lib/active_support/dependencies.rb:259:in `load_dependency'
activesupport (5.0.0.1) lib/active_support/dependencies.rb:293:in `require'
activerecord (5.0.0.1) lib/active_record/migration.rb:558:in `connection'
activerecord (5.0.0.1) lib/active_record/migration.rb:545:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/callbacks.rb:38:in `block in call'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:97:in `__run_callbacks__'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:750:in `_run_call_callbacks'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:90:in `run_callbacks'
actionpack (5.0.0.1) lib/action_dispatch/middleware/callbacks.rb:36:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call'
web-console (3.3.1) lib/web_console/middleware.rb:131:in `call_app'
web-console (3.3.1) lib/web_console/middleware.rb:28:in `block in call'
web-console (3.3.1) lib/web_console/middleware.rb:18:in `catch'
web-console (3.3.1) lib/web_console/middleware.rb:18:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.0.0.1) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.0.0.1) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.0.0.1) lib/active_support/tagged_logging.rb:70:in `block in tagged'
activesupport (5.0.0.1) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.0.0.1) lib/active_support/tagged_logging.rb:70:in `tagged'
railties (5.0.0.1) lib/rails/rack/logger.rb:24:in `call'
sprockets-rails (3.2.0) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/request_id.rb:24:in `call'
rack (2.0.1) lib/rack/method_override.rb:22:in `call'
rack (2.0.1) lib/rack/runtime.rb:22:in `call'
activesupport (5.0.0.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/static.rb:136:in `call'
rack (2.0.1) lib/rack/sendfile.rb:111:in `call'
railties (5.0.0.1) lib/rails/engine.rb:522:in `call'
puma (3.6.0) lib/puma/configuration.rb:225:in `call'
puma (3.6.0) lib/puma/server.rb:578:in `handle_request'
puma (3.6.0) lib/puma/server.rb:415:in `process_client'
puma (3.6.0) lib/puma/server.rb:275:in `block in run'
puma (3.6.0) lib/puma/thread_pool.rb:116:in `block in spawn_thread'

First try
gem uninstall sqlite3
then run
bundle install
If that didn't work make sure you don't have a username and password and your Environment variable are ok.
Last just a word of advice try to use postgresql as it'll be more helpful in production.

Related

"ActiveRecord::ConnectionNotEstablished" error after I switched from SQLite to Postgres

I recently switched my rails database over from sqlite3 to Postgres, and since then I've had a ConnectionNotEstablished error when trying to run my server. Is anyone familiar with this bug?
Here is the full stack trace of the error.
Is the server running on that host and accepting TCP/IP connections?
connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused (0x0000274D/10061)
Is the server running on that host and accepting TCP/IP connections?
):
activerecord (7.0.4) lib/active_record/connection_adapters/postgresql_adapter.rb:87:in `rescue in new_client'
activerecord (7.0.4) lib/active_record/connection_adapters/postgresql_adapter.rb:77:in `new_client'
activerecord (7.0.4) lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
activerecord (7.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `public_send'
activerecord (7.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `new_connection'
activerecord (7.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:700:in `checkout_new_connection'
activerecord (7.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:679:in `try_to_checkout_new_connection'
activerecord (7.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:640:in `acquire_connection'
activerecord (7.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:341:in `checkout'
activerecord (7.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:181:in `connection'
activerecord (7.0.4) lib/active_record/connection_adapters/abstract/connection_handler.rb:211:in `retrieve_connection'
activerecord (7.0.4) lib/active_record/connection_handling.rb:313:in `retrieve_connection'
activerecord (7.0.4) lib/active_record/connection_handling.rb:280:in `connection'
activerecord (7.0.4) lib/active_record/migration.rb:613:in `connection'
activerecord (7.0.4) lib/active_record/migration.rb:608:in `build_watcher'
activerecord (7.0.4) lib/active_record/migration.rb:590:in `block in call'
activerecord (7.0.4) lib/active_record/migration.rb:589:in `synchronize'
activerecord (7.0.4) lib/active_record/migration.rb:589:in `call'
actionpack (7.0.4) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
activesupport (7.0.4) lib/active_support/callbacks.rb:99:in `run_callbacks'
actionpack (7.0.4) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (7.0.4) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (7.0.4) lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call'
actionpack (7.0.4) lib/action_dispatch/middleware/debug_exceptions.rb:28:in `call'
web-console (4.2.0) lib/web_console/middleware.rb:132:in `call_app'
web-console (4.2.0) lib/web_console/middleware.rb:28:in `block in call'
web-console (4.2.0) lib/web_console/middleware.rb:17:in `catch'
web-console (4.2.0) lib/web_console/middleware.rb:17:in `call'
actionpack (7.0.4) lib/action_dispatch/middleware/show_exceptions.rb:26:in `call'
railties (7.0.4) lib/rails/rack/logger.rb:40:in `call_app'
railties (7.0.4) lib/rails/rack/logger.rb:25:in `block in call'
activesupport (7.0.4) lib/active_support/tagged_logging.rb:99:in `block in tagged'
activesupport (7.0.4) lib/active_support/tagged_logging.rb:37:in `tagged'
activesupport (7.0.4) lib/active_support/tagged_logging.rb:99:in `tagged'
railties (7.0.4) lib/rails/rack/logger.rb:25:in `call'
sprockets-rails (3.4.2) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (7.0.4) lib/action_dispatch/middleware/remote_ip.rb:93:in `call'
actionpack (7.0.4) lib/action_dispatch/middleware/request_id.rb:26:in `call'
rack (2.2.4) lib/rack/method_override.rb:24:in `call'
rack (2.2.4) lib/rack/runtime.rb:22:in `call'
activesupport (7.0.4) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
actionpack (7.0.4) lib/action_dispatch/middleware/server_timing.rb:61:in `block in call'
actionpack (7.0.4) lib/action_dispatch/middleware/server_timing.rb:26:in `collect_events'
actionpack (7.0.4) lib/action_dispatch/middleware/server_timing.rb:60:in `call'
actionpack (7.0.4) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (7.0.4) lib/action_dispatch/middleware/static.rb:23:in `call'
rack (2.2.4) lib/rack/sendfile.rb:110:in `call'
actionpack (7.0.4) lib/action_dispatch/middleware/host_authorization.rb:137:in `call'
railties (7.0.4) lib/rails/engine.rb:530:in `call'
puma (5.6.5) lib/puma/configuration.rb:252:in `call'
puma (5.6.5) lib/puma/request.rb:77:in `block in handle_request'
puma (5.6.5) lib/puma/thread_pool.rb:340:in `with_force_shutdown'
puma (5.6.5) lib/puma/request.rb:76:in `handle_request'
puma (5.6.5) lib/puma/server.rb:443:in `process_client'
puma (5.6.5) lib/puma/thread_pool.rb:147:in `block in spawn_thread'
// My Gem file
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby "2.7.6"
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.0.4"
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem "sprockets-rails"
# Use postgresql as the database for Active Record
gem "pg"
gem "hirb"
# Use the Puma web server [https://github.com/puma/puma]
gem "puma", "~> 5.0"
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
gem "importmap-rails"
# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
gem "turbo-rails"
# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
gem "stimulus-rails"
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
gem "jbuilder"
# Use Redis adapter to run Action Cable in production
# gem "redis", "~> 4.0"
# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
# gem "kredis"
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
gem "bcrypt", "~> 3.1.7"
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false
# Use Sass to process CSS
# gem "sassc-rails"
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"
group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", platforms: %i[ mri mingw x64_mingw ]
end
group :development do
# Use console on exceptions pages [https://github.com/rails/web-console]
gem "web-console"
# Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
# gem "rack-mini-profiler"
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
# gem "spring"
end
group :test do
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
gem "capybara"
gem "selenium-webdriver"
gem "webdrivers"
end
//database.yml
default: &default
adapter: postgresql
encoding: unicode
# For details on connection pooling, see Rails configuration guide
# https://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
development:
<<: *default
database: DojoSecrets_development
test:
<<: *default
database: DojoSecrets_test
production:
<<: *default
database: DojoSecrets_production
username: DojoSecrets
password: <%= ENV["DOJOSECRETS_DATABASE_PASSWORD"] %>
If there's any other files that might be helpful to see please let me know. Also, I have referenced this post: "https://stackoverflow.com/questions/12084368/activerecordconnectionnotestablished-after-switching-to-mysql-from-sqlite3" however, my Gemfile does not have the gem that it states was causing its issue.
Is the server running on that host and accepting TCP/IP connections?
connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused (0x0000274D/10061)
Is the server running on that host and accepting TCP/IP connections?
it says that your rails app can't connect to the psql server, probably because it's not turned on. How to turn it on/check the status depends on your setup (whether you're using docker or a local instance, a remote instance)

undefined local variable or method `mimes_for_respond_to' for DeviseController:Class error in Rails 6.0.0.0.alpha

I was working on Devise + active storage, need a method ActiveStorage::Blob#open which is available currently only in rails 6 vdersion so upgraded rails 5.2 to rails 6.0.0.alpha. After upgrading I'm getting this error. I tried many solutions but none of them work.
Started GET "/admins/sign_in" for 127.0.0.1 at 2018-06-05 08:23:21 +0530
(1.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
↳ /home/rotlu_crush/.rvm/gems/ruby-2.4.1/gems/activerecord-5.2.0/lib/active_record/log_subscriber.rb:98
ActionController::RoutingError (undefined local variable or method `mimes_for_respond_to' for DeviseController:Class):
devise (4.4.3) app/controllers/devise_controller.rb:18:in `<class:DeviseController>'
devise (4.4.3) app/controllers/devise_controller.rb:4:in `<main>'
bootsnap (1.3.0) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:100:in `load'
bootsnap (1.3.0) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:100:in `load'
activesupport (5.2.0) lib/active_support/dependencies.rb:468:in `block in load_file'
activesupport (5.2.0) lib/active_support/dependencies.rb:653:in `new_constants_in'
activesupport (5.2.0) lib/active_support/dependencies.rb:467:in `load_file'
activesupport (5.2.0) lib/active_support/dependencies.rb:365:in `block in require_or_load'
activesupport (5.2.0) lib/active_support/dependencies.rb:37:in `block in load_interlock'
activesupport (5.2.0) lib/active_support/dependencies/interlock.rb:14:in `block in loading'
activesupport (5.2.0) lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
activesupport (5.2.0) lib/active_support/dependencies/interlock.rb:13:in `loading'
activesupport (5.2.0) lib/active_support/dependencies.rb:37:in `load_interlock'
activesupport (5.2.0) lib/active_support/dependencies.rb:348:in `require_or_load'
activesupport (5.2.0) lib/active_support/dependencies.rb:502:in `load_missing_constant'
bootsnap (1.3.0) lib/bootsnap/load_path_cache/core_ext/active_support.rb:43:in `load_missing_constant'
activesupport (5.2.0) lib/active_support/dependencies.rb:193:in `const_missing'
devise (4.4.3) app/controllers/devise/sessions_controller.rb:3:in `<main>'
bootsnap (1.3.0) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:100:in `load'
bootsnap (1.3.0) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:100:in `load'
activesupport (5.2.0) lib/active_support/dependencies.rb:468:in `block in load_file'
activesupport (5.2.0) lib/active_support/dependencies.rb:653:in `new_constants_in'
activesupport (5.2.0) lib/active_support/dependencies.rb:467:in `load_file'
activesupport (5.2.0) lib/active_support/dependencies.rb:365:in `block in require_or_load'
activesupport (5.2.0) lib/active_support/dependencies.rb:37:in `block in load_interlock'
activesupport (5.2.0) lib/active_support/dependencies/interlock.rb:14:in `block in loading'
activesupport (5.2.0) lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
activesupport (5.2.0) lib/active_support/dependencies/interlock.rb:13:in `loading'
activesupport (5.2.0) lib/active_support/dependencies.rb:37:in `load_interlock'
activesupport (5.2.0) lib/active_support/dependencies.rb:348:in `require_or_load'
activesupport (5.2.0) lib/active_support/dependencies.rb:502:in `load_missing_constant'
bootsnap (1.3.0) lib/bootsnap/load_path_cache/core_ext/active_support.rb:43:in `load_missing_constant'
activesupport (5.2.0) lib/active_support/dependencies.rb:193:in `const_missing'
activesupport (5.2.0) lib/active_support/inflector/methods.rb:285:in `const_get'
activesupport (5.2.0) lib/active_support/inflector/methods.rb:285:in `block in constantize'
activesupport (5.2.0) lib/active_support/inflector/methods.rb:281:in `each'
activesupport (5.2.0) lib/active_support/inflector/methods.rb:281:in `inject'
activesupport (5.2.0) lib/active_support/inflector/methods.rb:281:in `constantize'
activesupport (5.2.0) lib/active_support/dependencies.rb:574:in `get'
activesupport (5.2.0) lib/active_support/dependencies.rb:605:in `constantize'
actionpack (5.2.0) lib/action_dispatch/http/request.rb:88:in `controller_class_for'
actionpack (5.2.0) lib/action_dispatch/http/request.rb:81:in `controller_class'
actionpack (5.2.0) lib/action_dispatch/routing/route_set.rb:46:in `controller'
actionpack (5.2.0) lib/action_dispatch/routing/route_set.rb:32:in `serve'
actionpack (5.2.0) lib/action_dispatch/routing/mapper.rb:18:in `block in <class:Constraints>'
actionpack (5.2.0) lib/action_dispatch/routing/mapper.rb:48:in `serve'
actionpack (5.2.0) lib/action_dispatch/journey/router.rb:52:in `block in serve'
actionpack (5.2.0) lib/action_dispatch/journey/router.rb:35:in `each'
actionpack (5.2.0) lib/action_dispatch/journey/router.rb:35:in `serve'
actionpack (5.2.0) lib/action_dispatch/routing/route_set.rb:840:in `call'
rack-pjax (1.0.0) lib/rack/pjax.rb:12:in `call'
remotipart (1.4.2) lib/remotipart/middleware.rb:32:in `call'
warden (1.2.7) lib/warden/manager.rb:36:in `block in call'
warden (1.2.7) lib/warden/manager.rb:35:in `catch'
warden (1.2.7) lib/warden/manager.rb:35:in `call'
rack (2.0.5) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.0.5) lib/rack/etag.rb:25:in `call'
rack (2.0.5) lib/rack/conditional_get.rb:25:in `call'
rack (2.0.5) lib/rack/head.rb:12:in `call'
actionpack (5.2.0) lib/action_dispatch/http/content_security_policy.rb:18:in `call'
rack (2.0.5) lib/rack/session/abstract/id.rb:232:in `context'
rack (2.0.5) lib/rack/session/abstract/id.rb:226:in `call'
actionpack (5.2.0) lib/action_dispatch/middleware/cookies.rb:670:in `call'
activerecord (5.2.0) lib/active_record/migration.rb:559:in `call'
actionpack (5.2.0) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (5.2.0) lib/active_support/callbacks.rb:98:in `run_callbacks'
actionpack (5.2.0) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (5.2.0) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (5.2.0) lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'
web-console (3.6.2) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.6.2) lib/web_console/middleware.rb:30:in `block in call'
web-console (3.6.2) lib/web_console/middleware.rb:20:in `catch'
web-console (3.6.2) lib/web_console/middleware.rb:20:in `call'
actionpack (5.2.0) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (5.2.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (5.2.0) lib/rails/rack/logger.rb:26:in `block in call'
activesupport (5.2.0) lib/active_support/tagged_logging.rb:71:in `block in tagged'
activesupport (5.2.0) lib/active_support/tagged_logging.rb:28:in `tagged'
activesupport (5.2.0) lib/active_support/tagged_logging.rb:71:in `tagged'
railties (5.2.0) lib/rails/rack/logger.rb:26:in `call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.2.0) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
actionpack (5.2.0) lib/action_dispatch/middleware/request_id.rb:27:in `call'
rack (2.0.5) lib/rack/method_override.rb:22:in `call'
rack (2.0.5) lib/rack/runtime.rb:22:in `call'
activesupport (5.2.0) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
actionpack (5.2.0) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (5.2.0) lib/action_dispatch/middleware/static.rb:127:in `call'
rack (2.0.5) lib/rack/sendfile.rb:111:in `call'
railties (5.2.0) lib/rails/engine.rb:524:in `call'
puma (3.11.4) lib/puma/configuration.rb:225:in `call'
puma (3.11.4) lib/puma/server.rb:632:in `handle_request'
puma (3.11.4) lib/puma/server.rb:446:in `process_client'
puma (3.11.4) lib/puma/server.rb:306:in `block in run'
puma (3.11.4) lib/puma/thread_pool.rb:120:in `block in spawn_thread'
Gem file:
ruby '2.4.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
# gem 'rails', '~> 5.2.0'
gem "rails", github: "rails/rails"
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
#
gem 'figaro'
gem 'devise'
# gem 'rails_admin', github: 'dtcristo/rails_admin', branch: 'active_storage'
gem 'rails_admin', github: 'dtcristo/rails_admin', branch: 'active_storage'
# gem 'rails_admin'
gem 'rails_admin_rollincode'
# gem "wysiwyg-rails"
gem "activerecord-import"
gem "simple_xlsx_reader"
If any one had same issue, please help to resolve this issue.
responder is a dependency of devise gem and others.
When trying to upgrading Rails (from 5.1.6 to 5.2.1) and Gemfile, somehow the responder gem was downgraded to version 0.6.5 (may be it was related to one of my gem in Gemfile)
Update the responder gem to latest version may fix this. For now it is version 2.4.0 which should work with devise 4.4.3
bundle update responders
Hope this helps!

NameError: uninitialized constant ShopifyApp

very new with ruby on rails. Apologize in advance for the somewhat obvious nature of this question.
I have a new rails app and I have included the shopify_app gem in my Gemfile. When trying to get the app up and running I am receiving the following error.
uninitialized constant ShopifyApp : in the following segment of code is where the error is occurring.
Rails.application.routes.draw do
root :to => 'home#index'
mount ShopifyApp::Engine, at: '/' # this is the line throwing the error
end
My question is , what could cause this error to be thrown? I believe this was installed when i ran bundle install ( with the shopify_app gem in the Gemfile) Please let me know if you need additional information. Any point in the right direction would be helpful for me. Thanks.
Here is the full trace associated with it as well.
config/routes.rb:3:in `block in <top (required)>'
actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:436:in `instance_exec'
actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:436:in `eval_block'
actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:418:in `draw'
config/routes.rb:1:in `<top (required)>'
railties (5.1.6) lib/rails/application/routes_reloader.rb:55:in `block in load_paths'
railties (5.1.6) lib/rails/application/routes_reloader.rb:55:in `each'
railties (5.1.6) lib/rails/application/routes_reloader.rb:55:in `load_paths'
railties (5.1.6) lib/rails/application/routes_reloader.rb:18:in `reload!'
railties (5.1.6) lib/rails/application/routes_reloader.rb:41:in `block in updater'
activesupport (5.1.6) lib/active_support/file_update_checker.rb:81:in `execute'
railties (5.1.6) lib/rails/application/routes_reloader.rb:25:in `execute'
railties (5.1.6) lib/rails/application/finisher.rb:141:in `block (2 levels) in <module:Finisher>'
activesupport (5.1.6) lib/active_support/callbacks.rb:413:in `instance_exec'
activesupport (5.1.6) lib/active_support/callbacks.rb:413:in `block in make_lambda'
activesupport (5.1.6) lib/active_support/callbacks.rb:197:in `block (2 levels) in halting'
activesupport (5.1.6) lib/active_support/callbacks.rb:601:in `block (2 levels) in default_terminator'
activesupport (5.1.6) lib/active_support/callbacks.rb:600:in `catch'
activesupport (5.1.6) lib/active_support/callbacks.rb:600:in `block in default_terminator'
activesupport (5.1.6) lib/active_support/callbacks.rb:198:in `block in halting'
activesupport (5.1.6) lib/active_support/callbacks.rb:507:in `block in invoke_before'
activesupport (5.1.6) lib/active_support/callbacks.rb:507:in `each'
activesupport (5.1.6) lib/active_support/callbacks.rb:507:in `invoke_before'
activesupport (5.1.6) lib/active_support/callbacks.rb:130:in `run_callbacks'
activesupport (5.1.6) lib/active_support/execution_wrapper.rb:108:in `run!'
activesupport (5.1.6) lib/active_support/reloader.rb:113:in `run!'
activesupport (5.1.6) lib/active_support/execution_wrapper.rb:70:in `block in run!'
activesupport (5.1.6) lib/active_support/execution_wrapper.rb:67:in `tap'
activesupport (5.1.6) lib/active_support/execution_wrapper.rb:67:in `run!'
activesupport (5.1.6) lib/active_support/reloader.rb:59:in `run!'
actionpack (5.1.6) lib/action_dispatch/middleware/executor.rb:10:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call'
web-console (3.6.0) lib/web_console/middleware.rb:137:in `call_app'
web-console (3.6.0) lib/web_console/middleware.rb:22:in `block in call'
web-console (3.6.0) lib/web_console/middleware.rb:20:in `catch'
web-console (3.6.0) lib/web_console/middleware.rb:20:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.1.6) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.1.6) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.1.6) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.1.6) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.1.6) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.1.6) lib/rails/rack/logger.rb:24:in `call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/request_id.rb:25:in `call'
rack (2.0.4) lib/rack/method_override.rb:22:in `call'
rack (2.0.4) lib/rack/runtime.rb:22:in `call'
activesupport (5.1.6) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.1.6) lib/action_dispatch/middleware/static.rb:125:in `call'
rack (2.0.4) lib/rack/sendfile.rb:111:in `call'
railties (5.1.6) lib/rails/engine.rb:522:in `call'
puma (3.11.3) lib/puma/configuration.rb:225:in `call'
puma (3.11.3) lib/puma/server.rb:624:in `handle_request'
puma (3.11.3) lib/puma/server.rb:438:in `process_client'
puma (3.11.3) lib/puma/server.rb:302:in `block in run'
puma (3.11.3) lib/puma/thread_pool.rb:120:in `block in spawn_thread'
This error occurred while loading the following files:
Gemfile:
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.6'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Shopify App Gem - should include Shopify API as well
gem 'shopify_app'
# 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', platforms: [:mri, :mingw, :x64_mingw]
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '~> 2.13'
gem 'selenium-webdriver'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console', '>= 3.3.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
It looks like you want to leave off at: '/'. You would only specify a NESTED route, one that wasn't / (root). You just want to mount in the root. As you can see here, it's going to create a bunch of routes for you.
https://github.com/Shopify/shopify_app#mounting-the-engine
Mounting the Engine will provide the basic routes to authenticating a shop with your application. By default it will provide:
Verb Route Action
GET '/login' Login
POST '/login' Login
GET '/auth/shopify/callback' Authenticate Callback
GET '/logout' Logout
POST '/webhooks/:type' Webhook Callback

Can't Run server with Rails 4.2.4.rc1

This is sort of related to my other question listed here, but those solutions didn't work for me so I created a new rails app, but I got the same error, which I've listed below.
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'
And here is the 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'
It's a last resort for me to regenerate all of the files from my website to a new app, but I'm not sure why it's happening with this new project. The only thing I've done is install two gems to help me with security, so maybe that's it but I'm not sure. Can anyone help?
I think I figured out the problem. I made a new app, without the two gems, and it worked. I went to my app and took out one of the gems (dawnscanner) and it worked.

NameError when I run my rails server

I ran the command rails server -p 8000 in the console to start my rails app, and I went to localhost:8000 in my browser, but I got an error saying something went wrong. I checked my console, and I saw this:
Started GET "/" for 127.0.0.1 at 2015-08-15 14:21:23 -0400
NameError (uninitialized constant ActiveModel::Validations::PresenceValidator):
activerecord (4.2.3) lib/active_record/validations/presence.rb:3:in `<module:Validations>'
activerecord (4.2.3) lib/active_record/validations/presence.rb:2:in `<module:ActiveRecord>'
activerecord (4.2.3) lib/active_record/validations/presence.rb:1:in `<top (required)>'
activerecord (4.2.3) lib/active_record/validations.rb:90:in `<top (required)>'
activerecord (4.2.3) lib/active_record/base.rb:294:in `<class:Base>'
activerecord (4.2.3) lib/active_record/base.rb:269:in `<module:ActiveRecord>'
activerecord (4.2.3) lib/active_record/base.rb:26:in `<top (required)>'
activerecord (4.2.3) lib/active_record/migration.rb:383:in `connection'
activerecord (4.2.3) lib/active_record/migration.rb:370:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.3) lib/active_support/callbacks.rb:84:in `run_callbacks'
actionpack (4.2.3) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.3) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.3) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.3) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.3) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.3) 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.3) 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.3) lib/action_dispatch/middleware/static.rb:116:in `call'
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
railties (4.2.3) lib/rails/engine.rb:518:in `call'
railties (4.2.3) 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'
I updated all of my gems yesterday, including rails, so I'm thinking it has something to do with that. Is there something I did wrong when I updated all of the gems? I ran the command, and then I updated the Gemfile, but did I miss anything? (Let me know if you want me to put the Gemfile in here as well)
Here's my Gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/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
# Use debugger
# gem 'debugger', group: [:development, :test]
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin]
# Scans for vulnerabilities
gem 'brakeman', '~> 3.0.5'
gem 'dawnscanner', '~> 1.3.5'
You have to require the whole of active_model since it uses autoload to "lazily require" classes as needed.
The following code works fine:
require 'active_model'
class Person
include ActiveModel::Validations
end
I think I figured out the problem. I made a new app, without the two gems, and it worked. I went to my app and took out one of the gems (dawnscanner) and it worked.

Resources