Rails服务器Gem加载错误-SQlite3

吕克滕瓦尔德

首先,我搜索并阅读了所有与我的问题相似的问题,并尝试了所有建议。如果有帮助,以下是一些我正在使用的技术:

  • 最初是High Sierra在2015年初的Macbook上使用(现已升级到Mojave)
  • 红宝石2.5.1
  • 导轨-5.0.0
  • 崇高3
  • iterm2
  • 铬+野生动物园

继Pragmatic Studios Rails 1课程之后,我安装了ruby 2.5.1和Rails 5.0.0新的捆绑软件检查,并且所有依赖项都满足捆绑软件安装等。

所以现在我有了一个新的Rails应用程序设置,我尝试rails s使用Puma服务器运行该应用程序似乎没有问题,但是当我尝试加载浏览器localhost3000时出现错误:

Gem::LoadError
Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).

当我在运行服务器时刷新页面时,出现此错误:

ActiveRecord::ConnectionNotEstablished
No connection pool with id primary found.

我已经检查了gem文件,并在那里找到了sqlite3。我已经重新安装了sqlite3。我已经完成了bundle exec rails服务器。我已经卸载了sqlite3并重新安装。我已经删除了Gemfile.lock文件,并捆绑了install(和exec)。我尝试了所有可以在网上找到的建议。

所以现在我想,也许我的系统搞砸了,我可以使用升级到Mojave的方式。

所以...我创建了一个可启动驱动器,删除了HD,并进行了全新安装。

现在,运行Mojave,并重新安装了上面列出的相同应用。

因此,我运行rails-出现相同的错误!这是我在Gemfile和Gemfile.lock中拥有的内容:

宝石文件:

来源' https://rubygems.org '

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# 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
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console'
  gem 'listen', '~> 3.0.5'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
----------

宝石锁:

GEM
  remote: https://rubygems.org/
  specs:
    actioncable (5.0.7.1)
      actionpack (= 5.0.7.1)
      nio4r (>= 1.2, < 3.0)
      websocket-driver (~> 0.6.1)
    actionmailer (5.0.7.1)
      actionpack (= 5.0.7.1)
      actionview (= 5.0.7.1)
      activejob (= 5.0.7.1)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (5.0.7.1)
      actionview (= 5.0.7.1)
      activesupport (= 5.0.7.1)
      rack (~> 2.0)
      rack-test (~> 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    actionview (5.0.7.1)
      activesupport (= 5.0.7.1)
      builder (~> 3.1)
      erubis (~> 2.7.0)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.3)
    activejob (5.0.7.1)
      activesupport (= 5.0.7.1)
      globalid (>= 0.3.6)
    activemodel (5.0.7.1)
      activesupport (= 5.0.7.1)
    activerecord (5.0.7.1)
      activemodel (= 5.0.7.1)
      activesupport (= 5.0.7.1)
      arel (~> 7.0)
    activesupport (5.0.7.1)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 0.7, < 2)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
    arel (7.1.4)
    bindex (0.5.0)
    builder (3.2.3)
    byebug (11.0.0)
    coffee-rails (4.2.2)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.12.2)
    concurrent-ruby (1.1.4)
    crass (1.0.4)
    erubis (2.7.0)
    execjs (2.7.0)
    ffi (1.10.0)
    globalid (0.4.2)
      activesupport (>= 4.2.0)
    i18n (1.5.3)
      concurrent-ruby (~> 1.0)
    jbuilder (2.8.0)
      activesupport (>= 4.2.0)
      multi_json (>= 1.2)
    jquery-rails (4.3.3)
      rails-dom-testing (>= 1, < 3)
      railties (>= 4.2.0)
      thor (>= 0.14, < 2.0)
    listen (3.0.8)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
    loofah (2.2.3)
      crass (~> 1.0.2)
      nokogiri (>= 1.5.9)
    mail (2.7.1)
      mini_mime (>= 0.1.1)
    method_source (0.9.2)
    mini_mime (1.0.1)
    mini_portile2 (2.4.0)
    minitest (5.11.3)
    multi_json (1.13.1)
    nio4r (2.3.1)
    nokogiri (1.10.1)
      mini_portile2 (~> 2.4.0)
    puma (3.12.0)
    rack (2.0.6)
    rack-test (0.6.3)
      rack (>= 1.0)
    rails (5.0.7.1)
      actioncable (= 5.0.7.1)
      actionmailer (= 5.0.7.1)
      actionpack (= 5.0.7.1)
      actionview (= 5.0.7.1)
      activejob (= 5.0.7.1)
      activemodel (= 5.0.7.1)
      activerecord (= 5.0.7.1)
      activesupport (= 5.0.7.1)
      bundler (>= 1.3.0)
      railties (= 5.0.7.1)
      sprockets-rails (>= 2.0.0)
    rails-dom-testing (2.0.3)
      activesupport (>= 4.2.0)
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.0.4)
      loofah (~> 2.2, >= 2.2.2)
    railties (5.0.7.1)
      actionpack (= 5.0.7.1)
      activesupport (= 5.0.7.1)
      method_source
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rake (12.3.2)
    rb-fsevent (0.10.3)
    rb-inotify (0.10.0)
      ffi (~> 1.0)
    sass (3.7.3)
      sass-listen (~> 4.0.0)
    sass-listen (4.0.0)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
    sass-rails (5.0.7)
      railties (>= 4.0.0, < 6)
      sass (~> 3.1)
      sprockets (>= 2.8, < 4.0)
      sprockets-rails (>= 2.0, < 4.0)
      tilt (>= 1.1, < 3)
    spring (2.0.2)
      activesupport (>= 4.2)
    spring-watcher-listen (2.0.1)
      listen (>= 2.7, < 4.0)
      spring (>= 1.2, < 3.0)
    sprockets (3.7.2)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.2.1)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    sqlite3 (1.4.0)
    thor (0.20.3)
    thread_safe (0.3.6)
    tilt (2.0.9)
    turbolinks (5.2.0)
      turbolinks-source (~> 5.2)
    turbolinks-source (5.2.0)
    tzinfo (1.2.5)
      thread_safe (~> 0.1)
    uglifier (4.1.20)
      execjs (>= 0.3.0, < 3)
    web-console (3.7.0)
      actionview (>= 5.0)
      activemodel (>= 5.0)
      bindex (>= 0.4.0)
      railties (>= 5.0)
    websocket-driver (0.6.5)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.3)

PLATFORMS
  ruby

DEPENDENCIES
  byebug
  coffee-rails (~> 4.2)
  jbuilder (~> 2.5)
  jquery-rails
  listen (~> 3.0.5)
  puma (~> 3.0)
  rails (~> 5.0.0)
  sass-rails (~> 5.0)
  spring
  spring-watcher-listen (~> 2.0.0)
  sqlite3
  turbolinks (~> 5)
  tzinfo-data
  uglifier (>= 1.3.0)
  web-console

BUNDLED WITH
   1.16.6
---------
吕克滕瓦尔德

来自PragmaticStudio的Mike Clark为我解决了这个问题!

嗯,似乎是2月4日发布的sqlite3 v1.4.0 gem的问题。有一个修复程序:

https://github.com/rails/rails/issues/35153

同时,您可以通过将该版本添加到Gemfile中的“ sqlite3”行来回退至v1.3.6,如下所示:

gem“ sqlite3”,“〜> 1.3.6”

然后确保“捆绑安装”。

无论如何,这为我解决了这个问题。我还发现这很有帮助:

https://stackoverflow.com/questions/54527277/cant-activate-sqlite3-1-3-6-already-activated-sqlite3-1-4-0/54606137#54606137

试试看,看看它是否适合您。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

'gem install sqlite3'错误

来自分类Dev

如何停止安装sqlite3适配器:`gem install activerecord-sqlite3-adapter'在服务器上

来自分类Dev

内部服务器错误:Python Flask渲染模板sqlite3

来自分类Dev

安装sqlite3 gem时出错

来自分类Dev

无法使用 gem 安装 sqlite3

来自分类Dev

关于Rails上SQLite3的困惑

来自分类Dev

为 Ruby on Rails 安装 sqlite3

来自分类Dev

NodeJS sqlite3获取错误消息

来自分类Dev

启动导轨,sqlite3错误

来自分类Dev

sqlite3:在“附近”。:语法错误

来自分类Dev

'宝石安装sqlite3'错误

来自分类Dev

SQLite3 UNIQUE约束失败错误

来自分类Dev

SQLite3创建表意外的“(”错误

来自分类Dev

sqlite3:在“附近”。:语法错误

来自分类Dev

SQLite3查询失败,错误不

来自分类Dev

SQLite3 磁盘 IO 错误

来自分类Dev

Bash sqlite3:错误:选项太多

来自分类Dev

sqlite3 类型 TEXT 输入错误

来自分类Dev

Python sqlite3 操作错误

来自分类Dev

Sqlite3 插入错误 C++

来自分类Dev

sqlite3 操作错误异常

来自分类Dev

如何停止安装sqlite3适配器:在服务器上安装“ gem install activerecord-sqlite3-adapter”

来自分类Dev

rails _4.2.11.1_ new 不加载“sqlite3”

来自分类Dev

Webpack sequelize,sqlite3错误找不到模块sqlite3

来自分类Dev

从Trac迁移到Redmine,并显示错误消息“未加载gem sqlite3”

来自分类Dev

Rails 4-Heroku Sqlite3错误

来自分类Dev

Apple Mach-O链接器错误sqlite3

来自分类Dev

Python3 sqlite3立即开始错误

来自分类Dev

Python3、Tkinter、SQLite3 - 登录编码错误