Rails server (create a new car)


#1

Hi , again I have stock on one of the steps
everything went ok so far , I put this command
rails server
gives me this output
rack (2.0.6) lib/rack/method_override.rb:22:in call' rack (2.0.6) lib/rack/runtime.rb:22:incall’
activesupport (5.2.2) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in call' actionpack (5.2.2) lib/action_dispatch/middleware/executor.rb:14:incall’
actionpack (5.2.2) lib/action_dispatch/middleware/static.rb:127:in call' rack (2.0.6) lib/rack/sendfile.rb:111:incall’
railties (5.2.2) lib/rails/engine.rb:524:in call' puma (3.12.0) lib/puma/configuration.rb:225:incall’
puma (3.12.0) lib/puma/server.rb:658:in handle_request' puma (3.12.0) lib/puma/server.rb:472:inprocess_client’
puma (3.12.0) lib/puma/server.rb:332:in block in run' puma (3.12.0) lib/puma/thread_pool.rb:133:inblock in spawn_thread’
I checked into the wepsite
http://localhost:3000/cars
There was a red title saying
No connection pool with ‘primary’ found.
and what does (add car mean)
how to create car


#2

What’s the full error there?


#3
  def retrieve_connection(spec_name) #:nodoc:
    pool = retrieve_connection_pool(spec_name)
    raise ConnectionNotEstablished, "No connection pool with '#{spec_name}' found." unless pool
    pool.connection
  end

#4

What’s the full error you are seeing in your terminal?


#5

ActiveRecord::ConnectionNotEstablished (No connection pool with ‘primary’ found.):

activerecord (5.2.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:1009:in retrieve_connection' activerecord (5.2.2) lib/active_record/connection_handling.rb:118:inretrieve_connection’
activerecord (5.2.2) lib/active_record/connection_handling.rb:90:in connection' activerecord (5.2.2) lib/active_record/migration.rb:554:incall’
actionpack (5.2.2) lib/action_dispatch/middleware/callbacks.rb:28:in block in call' activesupport (5.2.2) lib/active_support/callbacks.rb:98:inrun_callbacks’
actionpack (5.2.2) lib/action_dispatch/middleware/callbacks.rb:26:in call' actionpack (5.2.2) lib/action_dispatch/middleware/executor.rb:14:incall’
actionpack (5.2.2) lib/action_dispatch/middleware/debug_exceptions.rb:61:in call' web-console (3.7.0) lib/web_console/middleware.rb:135:incall_app’
web-console (3.7.0) lib/web_console/middleware.rb:30:in block in call' web-console (3.7.0) lib/web_console/middleware.rb:20:incatch’
web-console (3.7.0) lib/web_console/middleware.rb:20:in call' actionpack (5.2.2) lib/action_dispatch/middleware/show_exceptions.rb:33:incall’
railties (5.2.2) lib/rails/rack/logger.rb:38:in call_app' railties (5.2.2) lib/rails/rack/logger.rb:26:inblock in call’
activesupport (5.2.2) lib/active_support/tagged_logging.rb:71:in block in tagged' activesupport (5.2.2) lib/active_support/tagged_logging.rb:28:intagged’
activesupport (5.2.2) lib/active_support/tagged_logging.rb:71:in tagged' railties (5.2.2) lib/rails/rack/logger.rb:26:incall’
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in call' actionpack (5.2.2) lib/action_dispatch/middleware/remote_ip.rb:81:incall’
actionpack (5.2.2) lib/action_dispatch/middleware/request_id.rb:27:in call' rack (2.0.6) lib/rack/method_override.rb:22:incall’
rack (2.0.6) lib/rack/runtime.rb:22:in call' activesupport (5.2.2) lib/active_support/cache/strategy/local_cache_middleware.rb:29:incall’
actionpack (5.2.2) lib/action_dispatch/middleware/executor.rb:14:in call' actionpack (5.2.2) lib/action_dispatch/middleware/static.rb:127:incall’
rack (2.0.6) lib/rack/sendfile.rb:111:in call' railties (5.2.2) lib/rails/engine.rb:524:incall’
puma (3.12.0) lib/puma/configuration.rb:225:in call' puma (3.12.0) lib/puma/server.rb:658:inhandle_request’
puma (3.12.0) lib/puma/server.rb:472:in process_client' puma (3.12.0) lib/puma/server.rb:332:inblock in run’
puma (3.12.0) lib/puma/thread_pool.rb:133:in `block in spawn_thread’


#6

Is that everything?


#7

this is the whole output
mayism@DESKTOP-ADNT3RD:~/odin_on_rails/my_first_rails_app$ rails server
/home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/railties-5.2.2/lib/rails/app_loader.rb:53: warning: Insecure world writable dir /home/mayism/.rbenv/versions in PATH, mode 040777
=> Booting Puma
=> Rails 5.2.2 application starting in development
=> Run rails server -h for more startup options
Puma starting in single mode…

  • Version 3.12.0 (ruby 2.6.0-p0), codename: Llamas in Pajamas
  • Min threads: 5, max threads: 5
  • Environment: development
  • Listening on tcp://0.0.0.0:3000
    Use Ctrl-C to stop
    2019-02-21 12:19:11 +0200: Rack app error handling request { GET /cars }
    #<LoadError: Error loading the ‘sqlite3’ Active Record adapter. Missing a gem it depends on? can’t activate sqlite3 (~> 1.3.6), already activated sqlite3-1.4.0. Make sure all dependencies are added to Gemfile.>
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/rubygems_integration.rb:408:in block (2 levels) in replace_gem' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:12:in‘/home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in require' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:inblock in require_with_bootsnap_lfi’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:83:in register' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:inrequire_with_bootsnap_lfi’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in require' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:inblock in require’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in load_dependency' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:inrequire’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/connection_specification.rb:191:in spec' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:952:inestablish_connection’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activerecord-5.2.2/lib/active_record/connection_handling.rb:60:in establish_connection' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activerecord-5.2.2/lib/active_record/railtie.rb:136:inblock (2 levels) in class:Railtie
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:71:in instance_eval' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:71:inblock in execute_hook’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:62:in with_execution_control' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:67:inexecute_hook’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:52:in block in run_load_hooks' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:51:ineach’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:51:in run_load_hooks' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activerecord-5.2.2/lib/active_record/base.rb:328:inmodule:ActiveRecord
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activerecord-5.2.2/lib/active_record/base.rb:27:in <main>' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:inrequire’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in block in require_with_bootsnap_lfi' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:83:inregister’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in require_with_bootsnap_lfi' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:inrequire’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in block in require' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:inload_dependency’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in require' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activerecord-5.2.2/lib/active_record/query_cache.rb:29:inrun’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/execution_wrapper.rb:27:in before' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:426:inblock in make_lambda’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:198:in block (2 levels) in halting' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:606:inblock (2 levels) in default_terminator’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:605:in catch' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:605:inblock in default_terminator’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:199:in block in halting' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:513:inblock in invoke_before’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:513:in each' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:513:ininvoke_before’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:131:in run_callbacks' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/execution_wrapper.rb:110:inrun!’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/execution_wrapper.rb:72:in block in run!' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/execution_wrapper.rb:69:intap’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/execution_wrapper.rb:69:in run!' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/executor.rb:12:incall’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/static.rb:127:in call' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/rack-2.0.6/lib/rack/sendfile.rb:111:incall’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/railties-5.2.2/lib/rails/engine.rb:524:in call' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/puma-3.12.0/lib/puma/configuration.rb:225:incall’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/puma-3.12.0/lib/puma/server.rb:658:in handle_request' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/puma-3.12.0/lib/puma/server.rb:472:inprocess_client’
    /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/puma-3.12.0/lib/puma/server.rb:332:in block in run' /home/mayism/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/puma-3.12.0/lib/puma/thread_pool.rb:133:inblock in spawn_thread’

Started GET “/cars” for 127.0.0.1 at 2019-02-21 12:32:41 +0200

ActiveRecord::ConnectionNotEstablished (No connection pool with ‘primary’ found.):

activerecord (5.2.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:1009:in retrieve_connection' activerecord (5.2.2) lib/active_record/connection_handling.rb:118:inretrieve_connection’
activerecord (5.2.2) lib/active_record/connection_handling.rb:90:in connection' activerecord (5.2.2) lib/active_record/migration.rb:554:incall’
actionpack (5.2.2) lib/action_dispatch/middleware/callbacks.rb:28:in block in call' activesupport (5.2.2) lib/active_support/callbacks.rb:98:inrun_callbacks’actionpack (5.2.2) lib/action_dispatch/middleware/callbacks.rb:26:in call'actionpack (5.2.2) lib/action_dispatch/middleware/executor.rb:14:incall’
actionpack (5.2.2) lib/action_dispatch/middleware/debug_exceptions.rb:61:in call' web-console (3.7.0) lib/web_console/middleware.rb:135:incall_app’
web-console (3.7.0) lib/web_console/middleware.rb:30:in block in call' web-console (3.7.0) lib/web_console/middleware.rb:20:incatch’
web-console (3.7.0) lib/web_console/middleware.rb:20:in call' actionpack (5.2.2) lib/action_dispatch/middleware/show_exceptions.rb:33:incall’
railties (5.2.2) lib/rails/rack/logger.rb:38:in call_app' railties (5.2.2) lib/rails/rack/logger.rb:26:inblock in call’
activesupport (5.2.2) lib/active_support/tagged_logging.rb:71:in block in tagged' activesupport (5.2.2) lib/active_support/tagged_logging.rb:28:intagged’
activesupport (5.2.2) lib/active_support/tagged_logging.rb:71:in tagged' railties (5.2.2) lib/rails/rack/logger.rb:26:incall’
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in call' actionpack (5.2.2) lib/action_dispatch/middleware/remote_ip.rb:81:incall’actionpack (5.2.2) lib/action_dispatch/middleware/request_id.rb:27:in call' rack (2.0.6) lib/rack/method_override.rb:22:incall’
rack (2.0.6) lib/rack/runtime.rb:22:in call' activesupport (5.2.2) lib/active_support/cache/strategy/local_cache_middleware.rb:29:incall’
actionpack (5.2.2) lib/action_dispatch/middleware/executor.rb:14:in call' actionpack (5.2.2) lib/action_dispatch/middleware/static.rb:127:incall’
rack (2.0.6) lib/rack/sendfile.rb:111:in call' railties (5.2.2) lib/rails/engine.rb:524:incall’
puma (3.12.0) lib/puma/configuration.rb:225:in call' puma (3.12.0) lib/puma/server.rb:658:inhandle_request’
puma (3.12.0) lib/puma/server.rb:472:in process_client' puma (3.12.0) lib/puma/server.rb:332:inblock in run’
puma (3.12.0) lib/puma/thread_pool.rb:133:in `block in spawn_thread’
Started GET “/cars” for 127.0.0.1 at 2019-02-21 12:33:50 +0200


#8

I believe this thread might be of some use to you.