0

Before I reload my localhost:3000 webpage it says this:

$ rails s
=> Booting Puma
=> Rails 6.0.1 application starting in development
=> Run `rails server --help` for more startup options
*** SIGUSR2 not implemented, signal based restart unavailable!
*** SIGUSR1 not implemented, signal based restart unavailable!
*** SIGHUP not implemented, signal based logs reopening unavailable!
Puma starting in single mode...
* Version 4.3.0 (ruby 2.6.5-p114), codename: Mysterious Traveller
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://[::1]:3000
* Listening on tcp://127.0.0.1:3000
Use Ctrl-C to stop

Then after I reload:

2019-11-29 20:18:59 -0800: Rack app error handling request { GET / }
#<LoadError: Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? can't activate sqlite3 (~> 1.4), already activated sqlite3-1.3.13.20180326210955. Make sure all dependencies are added to Gemfile.>
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/rubygems_integration.rb:406:in `block (2 levels) in replace_gem'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:13:in `<top (required)>'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/zeitwerk-2.2.2/lib/zeitwerk/kernel.rb:23:in `require'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/zeitwerk-2.2.2/lib/zeitwerk/kernel.rb:23:in `require'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.1/lib/active_record/connection_adapters/connection_specification.rb:170:in `spec'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:1054:in `establish_connection'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.1/lib/active_record/connection_handling.rb:51:in `establish_connection'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.1/lib/active_record/railtie.rb:201:in `block (2 levels) in <class:Railtie>'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:72:in `class_eval'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:72:in `block in execute_hook'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:51:in `each'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.1/lib/active_record/base.rb:327:in `<module:ActiveRecord>'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.1/lib/active_record/base.rb:27:in `<top (required)>'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/zeitwerk-2.2.2/lib/zeitwerk/kernel.rb:23:in `require'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/zeitwerk-2.2.2/lib/zeitwerk/kernel.rb:23:in `require'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-6.0.1/lib/active_record/query_cache.rb:31:in `run'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/execution_wrapper.rb:28:in `before'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/callbacks.rb:429:in `block in make_lambda'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/callbacks.rb:201:in `block (2 levels) in halting'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/callbacks.rb:607:in `block (2 levels) in default_terminator'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/callbacks.rb:606:in `catch'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/callbacks.rb:606:in `block in default_terminator'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/callbacks.rb:202:in `block in halting'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/callbacks.rb:514:in `block in invoke_before'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/callbacks.rb:514:in `each'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/callbacks.rb:514:in `invoke_before'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/callbacks.rb:134:in `run_callbacks'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/execution_wrapper.rb:111:in `run!'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/execution_wrapper.rb:73:in `block in run!'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/execution_wrapper.rb:70:in `tap'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/execution_wrapper.rb:70:in `run!'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/actionpack-6.0.1/lib/action_dispatch/middleware/executor.rb:12:in `call'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/actionpack-6.0.1/lib/action_dispatch/middleware/static.rb:126:in `call'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rack-2.0.7/lib/rack/sendfile.rb:111:in `call'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/actionpack-6.0.1/lib/action_dispatch/middleware/host_authorization.rb:83:in `call'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/webpacker-4.2.0/lib/webpacker/dev_server_proxy.rb:23:in `perform_request'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rack-proxy-0.6.5/lib/rack/proxy.rb:57:in `call'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/engine.rb:526:in `call'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/puma-4.3.0/lib/puma/configuration.rb:228:in `call'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/puma-4.3.0/lib/puma/server.rb:667:in `handle_request'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/puma-4.3.0/lib/puma/server.rb:470:in `process_client'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/puma-4.3.0/lib/puma/server.rb:328:in `block in run'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/puma-4.3.0/lib/puma/thread_pool.rb:134:in `block in spawn_thread'

Here is what I have in my gemfile for SQLite3:

gem 'sqlite3', git: "https://github.com/larskanis/sqlite3-ruby", branch: "add-gemspec"

I'm running these versions:

$ sqlite3 --version
3.30.1

$ rails -v
Rails 6.0.1

$ ruby -v
ruby 2.6.5p114

I have been trying to start a Rails server for the past three days and this is the furthest I have gotten. I guess there is a discrepancy between what is in my gemfile and whatever else it's checking. I'm trying to follow a YouTube tutorial for making my first application.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
  • Why are you using a fork of sqlite from Github? – Casper Nov 30 '19 at 05:13
  • Only one that works to a point. Here are other ones I have tried: gem 'sqlite3' gem 'sqlite3', '< 1.4' gem 'sqlite3', git: "https://github.com/larskanis/sqlite3-ruby", branch: "add-gemspec" gem "sqlite3", "~> 1.3.6" – Ethan Middleton Nov 30 '19 at 05:23
  • Perhaps it's not a good idea to try to run the latest and greatest version. I would try to uninstalll this 6.0.1 version, and install the last one from the v5 branch, which is 5.2.4 (`gem uninstall rails; gem install rails -v 5.2.4`). Then try again. – Casper Nov 30 '19 at 05:23
  • If you're running into the wall with sqlite - just don't use it. Rails defaults to because it's (usually) an easy to setup db for rapid prototyping and learning. It's not what you are going to actually deploy on and not what you should dev/test real apps on. I would suggest you go for postgres instead. – max Nov 30 '19 at 05:46
  • @Casper I had trouble with trying to downgrade my rails version. Is there an alternative way to downgrade as the commands just lead to errors for me. Thanks – Ethan Middleton Nov 30 '19 at 05:50
  • I'd recommend using a better tutorial. A video isn't as thorough as a good book or site. – the Tin Man Nov 30 '19 at 05:52
  • @max How exactly would I replace sqlite3 with postgres? – Ethan Middleton Nov 30 '19 at 05:52
  • @theTinMan The tutorial doesn't experience the errors I am having so I am just troubleshooting myself. – Ethan Middleton Nov 30 '19 at 05:53
  • Do you have the exact same OS and OS version, version of Ruby, gem, drivers? When was the tutorial created? The internet remembers forever but our systems don't remain static, they change, so unless that tutorial is current with your system you can't trust it. And, since you didn't tell us _which_ tutorial, we can't help you much as we're shooting blindly in the dark. – the Tin Man Nov 30 '19 at 06:07
  • @theTinMan I feel like what tutorial I am watching is irrelevant as my main goal right now is just to start the rails server. After I start the server I can continue with the video. – Ethan Middleton Nov 30 '19 at 06:14
  • Ethan, I suspect the v5 branch is more likely to work on Windows. But it's just a guess. I would not downgrade anything. I would delete the whole Rails app and make a new one in the v5 branch. You can save the modified files if you edited anything, and then copy paste the changes over to the new one. Even the tutorial that said for you to use a Github version for SQLite was for Rails 5.2.2! You'll find much more help for Rails v5 problems on Windows since it's been around longer. On v6 you'll most likely be on your own. Maybe try to file a Github issue instead if you still want to try though. – Casper Nov 30 '19 at 14:40
  • Maybe see this one also: https://stackoverflow.com/questions/54527277/cant-activate-sqlite3-1-3-6-already-activated-sqlite3-1-4-0/54606137#54606137 Notice it's for Rails 5.2.2 though. – Casper Nov 30 '19 at 14:50
  • Thanks guys for the help. I guess I will downgrade to railsv5 and take it from there. :3 – Ethan Middleton Nov 30 '19 at 21:17

1 Answers1

1

This worked for me:

At first install Webpacker configuration file not found - Rails 6.0.0

Then change your sqllite3 gem for this: gem 'sqlite3', '~> 1.3', '>= 1.3.6'

For me worked well. version 6.0.2