簡體   English   中英

使用Heroku db獲取SQLite錯誤:當我使用PostgreSQL作為開發數據庫時推送

[英]Get SQLite error using heroku db:push when I'm using PostgreSQL as development db

我在將數據從我的開發數據庫推送到Heroku時遇到了問題。 我決定切換到PostgreSQL作為我的開發數據庫並更新了database.yml並從gemfiles中刪除了sqlite gem。

該應用程序運行良好對PostgreSQL但當我嘗試運行命令時:

heroku db:push

我得到一個令人費解的SQLite錯誤,因為我的項目中沒有對sqlite的引用:

 !    Taps Load Error: cannot load such file -- sqlite3
 !    You may need to install or update the taps gem to use db commands.
 !    On most systems this will be:
 !    
 !    sudo gem install taps

這是我的database.yml文件:

development:
  adapter: postgresql
  encoding: unicode
  database: xxxx
  pool: 5
  timeout: 5000
  username: xxxx
  password: xxxx

test:
  adapter: postgresql
  encoding: unicode
  database: test
  pool: 5
  timeout: 5000
  username: xx
  password: xx

production:
  adapter: postgresql
  encoding: unicode
  database: test
  pool: 5
  timeout: 5000

我正在使用RVM,我創造了一個沒有任何運氣的新寶石。

我甚至試過這個但得到了同樣的SQLite錯誤:

heroku db:push postgres://xx:xx@localhost/xx

 !    Taps Load Error: cannot load such file -- sqlite3
 !    You may need to install or update the taps gem to use db commands.
 !    On most systems this will be:
 !    
 !    sudo gem install taps

我還運行了bundle install和bundle update。

約翰

我遇到了同樣的問題並通過將我的gem文件中的水龍頭移動到開發組來解決它需要sqlite,這就是導致問題的原因。

group :development do
  gem 'taps', :require => false # has an sqlite dependency, which heroku hates
end

解決方案是不僅將taps gem和sqlite3 gem添加到:development組中。 如果您已經在開發sqlite3中使用,那么只需添加taps gem即可。 但我在我的開發中使用mysql所以要解決這個問題,我必須添加兩者。

group :development do
  gem 'taps'
  gem 'sqlite3'
end
gem install sqlite3

為我解決了。

在我的debian wheezy上我需要安裝:

aptitude install libsqlite3-dev
gem install sqlite3 

是你所需要的全部。 錯誤來自本地,而不是來自Heroku

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM