我在将数据从我的开发数据库推送到Heroku时遇到了问题。我决定切换到PostgreSQL作为我的开发db并更新了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而且我已经创建了一个没有任何运气的新gemset。
我甚至试过这个,但得到了同样的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。
约翰
答案 0 :(得分:10)
我遇到了同样的问题并通过在我的gemfile中将水龙头移动到开发组来解决它需要sqlite,这就是导致问题的原因。
group :development do
gem 'taps', :require => false # has an sqlite dependency, which heroku hates
end
答案 1 :(得分:8)
解决方案是不仅将taps
gem和sqlite3
gem添加到:development
组中。如果您已经在开发sqlite3
中使用,那么只需添加taps
gem即可。但是我在我的开发中使用mysql
所以要解决这个问题,我必须添加它们。
group :development do
gem 'taps'
gem 'sqlite3'
end
答案 2 :(得分:4)
gem install sqlite3
为我解决了。
答案 3 :(得分:0)
在我的debian wheezy上我需要安装:
aptitude install libsqlite3-dev
答案 4 :(得分:0)
gem install sqlite3
你需要的只是。错误来自本地,而不是来自Heroku