Gem :: LoadError:尝试在Heroku上进行部署时-Rails 4 [英] Gem::LoadError: when trying to deploy on Heroku - Rails 4

查看:63
本文介绍了Gem :: LoadError:尝试在Heroku上进行部署时-Rails 4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将一个应用程序(仅是Rails教程中的一个简单应用程序)部署到heroku,但它一直给我同样的错误消息.我使用命令:

I am trying to deploy an app (just a simple app from a Rails tutorial) to heroku but it keeps giving me the same error message. I use the command:

git push heroku master

启动正常,然后突然出现此错误:

It starts well, and then suddenly appears this error:

-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       Gem::LoadError: Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile.

我已经捆绑安装了,一切都顺利进行.

I did bundle install already, everything went smooth there.

这是我的宝石文件:

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

也许我在databse.yml文件中缺少某些内容?

Maybe something I am missing something on databse.yml file?

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

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: sqlite3
  database: db/test.sqlite3
  pool: 5
  timeout: 5000

production:
  adapter: sqlite3
  database: db/production.sqlite3
  pool: 5
  timeout: 5000

顺便说一句,我不知道它是否有帮助,但是我正在使用Rails 4.0.4,Ruby 2.1.1和Mac上已经安装的SQLite版本3.7.13

By the way, I don't know if it helps, but I am using Rails 4.0.4, Ruby 2.1.1 and the version of SQLite which comes already installed on Mac, which is 3.7.13

推荐答案

SQLite 不适用于生产级数据库.相反,Heroku提供了生产级 PostgreSQL 数据库即服务.

SQLite is not intended as a production grade database. Instead Heroku provides production grade PostgreSQL databases as a service.

阅读详细信息 Heroku上的SQLite

Read the details SQLite on Heroku

这篇关于Gem :: LoadError:尝试在Heroku上进行部署时-Rails 4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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