加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Ruby Guard问题 – ‘请安装sqlite3适配器’ – railstutorial.o

发布时间:2020-12-16 19:15:01 所属栏目:百科 来源:网络整理
导读:我跟随 Ruby on Rails Tutorial并且在测试部分中有些困惑,特别是 – 3.6.2 – Automated tests with Guard 根据教程的部署到Heroku的说明,我已切换到Postgresql并从我的gemfile中删除了sqlite3并进行了一个bundle install以进行更新. 但是,一旦我跑了 bundle
我跟随 Ruby on Rails Tutorial并且在测试部分中有些困惑,特别是 – 3.6.2 – Automated tests with Guard

根据教程的部署到Heroku的说明,我已切换到Postgresql并从我的gemfile中删除了sqlite3并进行了一个bundle install以进行更新.

但是,一旦我跑了

bundle exec guard

我收到的消息是:

/Users/username/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.1.3/lib/bundler/rubygems_integration.rb:147:in block in replace_gem': Please install the sqlite3 adapter:gem install activerecord-sqlite3-adapter` (sqlite3 is not part of the bundle. Add it to Gemfile.) (LoadError)

我很困惑为什么我需要这个,因为sqlite3已从我的环境中删除?

我的Gemfile如下:

source 'https://rubygems.org'

gem 'rails','3.2.3'
gem 'pg','0.12.2'

group :development,:test do
  gem 'rspec-rails','2.9.0'
  gem 'guard-rspec','0.5.5'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails','3.2.4'
  gem 'coffee-rails','3.2.2'
  gem 'uglifier','1.2.3'
end

gem 'jquery-rails','2.0.0'

group :test do
    gem 'rspec-rails','2.9.0'
  gem 'capybara','1.1.2'
  gem 'rb-fsevent',:require => false
  gem 'growl','1.0.3'
  gem 'spork','0.9.0'
end

我有点困惑,因为教程中的Gemfile再次显示sqlite3,即使它已在本教程的上一部分中删除了.

解决方法

更新数据库配置文件以使用postgresql适配器:
adapter: postgresql
encoding: unicode
database:
username:
password:

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读