无法加载“active_record/connection_adapters/sqlite3_adapter" [英] Could not load 'active_record/connection_adapters/sqlite3_adapter'

查看:42
本文介绍了无法加载“active_record/connection_adapters/sqlite3_adapter"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的笔记本电脑(Debian Wheezy 64 位)上安装 ROR.

I'm trying to install ROR on my notebook (Debian Wheezy 64 bit).

起初我遇到了这个问题(在此处输入链接描述 ) 由第一个答案解决.

On first I had this issue (enter link description here ) solved by the first answer.

现在 rails 服务器启动了,但是在浏览器上浏览 localhost:3000 我收到以下错误:

Now the rails server starts, but surfing on the browser at localhost:3000 I get the following error:

无法加载active_record/connection_adapters/sqlite3_adapter".确保 config/database.yml 中的适配器有效.如果您使用mysql"、mysql2"、postgresql"或sqlite3"以外的适配器,请将必要的适配器 gem 添加到 Gemfile 中.

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 'mysql', 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile.

我已经安装了 ruby​​ 2.0.0 编译源代码,没有错误或错误.然后我安装了一些需要的库(sqlite3、libsqlite3-dev)...

I've installed ruby 2.0.0 compiling the source code, no errors or mistakes. Then I've installed some needed libraries (sqlite3, libsqlite3-dev )...

这是我的 GemFile:

Here is my GemFile:

'https://rubygems.org'

-# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'

-# Use sqlite3 as the database for Active Record
gem 'sqlite3'

-# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'

-# 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', '~> 1.2'

group :doc do
  -# bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

-# Use ActiveModel has_secure_password
-# gem 'bcrypt-ruby', '~> 3.0.0'

-# Use unicorn as the app server
-# gem 'unicorn'

-# Use Capistrano for deployment
-# gem 'capistrano', group: :development

-# Use debugger
-# gem 'debugger', group: [:development, :test]

gem 'execjs'
gem 'therubyracer'

在我的 database.yml 中:

And in my database.yml:

-# SQLite version 3.x
-#   gem install sqlite3
-#
-#   Ensure the SQLite 3 gem is defined in your Gemfile
-#   gem 'sqlite3'
development:
  adapter: sqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000

我的宝石版本:

ruby 2.0.0
rails 4.0.0
sqlite 1.3.7

推荐答案

今天在 Sinatra 中运行 rake db:create_migration 时遇到了这个错误.我的错误是在 app.rb 中错误地指定了sqlite:"数据库类型,而它应该是sqlite 3:".示例:

Came across this error playing around in Sinatra today when running rake db:create_migration. My error was erroneously specifying a "sqlite:" database type in app.rb when it should have been "sqlite 3 :". Example:

错误:

set :database, 'sqlite:name.db'

正确:

set :database, 'sqlite3:name.db'

这篇关于无法加载“active_record/connection_adapters/sqlite3_adapter"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆