Ruby Guard问题-'请安装sqlite3适配器'-railstutorial.org [英] Ruby Guard questions - 'Please install the sqlite3 adapter' - railstutorial.org

查看:83
本文介绍了Ruby Guard问题-'请安装sqlite3适配器'-railstutorial.org的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在遵循 Ruby on Rails教程,并且在测试部分有些困惑,尤其是-3.6.2-使用Guard进行自动测试

I am following along the Ruby on Rails Tutorial and have gotten somewhat confused in the testing section, in particular - 3.6.2 - Automated tests with Guard

根据教程中有关将其部署到Heroku的说明,我已切换到Postgresql并从我的gemfile中删除了sqlite3,并进行了捆绑安装以进行更新。

As per the tutorial's instructions for deployment to Heroku, I've switched over to Postgresql and removed sqlite3 from my gemfile and did a bundle install to update.

但是,一旦我运行


捆绑执行卫兵

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 replace_gem中的块':请安装sqlite3适配器: gem install activerecord-sqlite3-adapter` (sqlite3不属于捆绑软件。将其添加到Gemfile中。)(LoadError)

/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已从我的环境中删除?

I'm confused why I need this as sqlite3 has been removed from my environment?

我的Gemfile如下:

My Gemfile is as follows:

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,即使在本教程的上一节中将其删除了。

I'm a bit confused because the Gemfile in the tutorial shows sqlite3 again even though it was removed in the previous section of the tutorial.

推荐答案

更新数据库配置文件以使用PostgreSQL适配器:

Update your database config file to use postgresql adapter:

adapter: postgresql
encoding: unicode
database:
username:
password:

这篇关于Ruby Guard问题-'请安装sqlite3适配器'-railstutorial.org的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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