加载'sqlite3'活动记录适配器时出错,Ruby on Rails 错误 Win10 64 位



在我重新加载我的本地主机:3000网页之前,它说:

$ 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

然后在我重新加载后:

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'

这是我在 SQLite3 的 gemfile 中的内容:

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

我正在运行这些版本:

$ sqlite3 --version
3.30.1
$ rails -v
Rails 6.0.1
$ ruby -v
ruby 2.6.5p114

在过去的三天里,我一直在尝试启动一个Rails服务器,这是我得到的最远的服务器。我想我的 gemfile 中的内容与它正在检查的任何其他内容之间存在差异。我正在尝试按照YouTube教程进行我的第一个应用程序。

这对我有用:

首次安装 Webpacker 配置文件时未找到 - Rails 6.0.0

然后为此更改您的 sqllite3 gem:gem 'sqlite3', '~> 1.3', '>= 1.3.6'

对我来说效果很好。 版本 6.0.2

最新更新