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

前端之家收集整理的这篇文章主要介绍了Ruby Guard问题 – ‘请安装sqlite3适配器’ – railstutorial.org前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我跟随 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:
原文链接:https://www.f2er.com/ruby/270457.html

猜你在找的Ruby相关文章