我需要在heroku上解析sqlite文件,据我所知,Heroku不支持sqlite。
在本地,我正在使用gem sqlite3,但在推送heroku时被拒绝。 如何在生产中使用'require sqlite3'?
这是错误:
An error occurred while installing sqlite3 (1.3.6), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.6'` succeeds before bundling.
Failed to install gems via Bundler.
Heroku push rejected, failed to compile Ruby/rails app
提前致谢
答案 0 :(得分:2)
很确定你不想这样做:https://devcenter.heroku.com/articles/how-do-i-use-sqlite3-for-development
Heroku不支持sqlite,你必须使用PostgreSQL。对不起老兄。
这个旧的SO线程有一个解决方法:
Deploying RoR app to Heroku with Sqlite3 fails
那里的获胜答案只是使用sqlite for dev所以:(复制粘贴)
group :production, :staging do
gem "pg"
end
group :development, :test do
gem "sqlite3-ruby", "~> 1.3.0", :require => "sqlite3"
end