繁体   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