[英]Gem::LoadError: when trying to deploy on Heroku - Rails 4
我正在嘗試將一個應用程序(僅是Rails教程中的一個簡單應用程序)部署到heroku,但它一直給我同樣的錯誤消息。 我使用以下命令:
git push heroku master
它啟動良好,然后突然出現此錯誤:
-----> 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.
我已經捆綁安裝了,一切順利。
這是我的Gemfile:
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
也許我在databse.yml文件上缺少了某些內容?
# 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。
Kirti說對了,Heroku不支持sqlite作為適配器,
請執行下列操作
在Gemfile中:
group :production, :staging do
gem 'pg'
end
group :development, :test do
gem 'sqlite3'
end
在database.yml中
production:
adapter: postgresql
database: name_of_your_db
pool: 5
timeout: 5000
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.