使用sqlite3部署到Heroku错误

时间:2014-04-22 14:42:37

标签: ruby-on-rails ruby postgresql heroku sqlite

我正在尝试将我的rails应用程序部署到Heroku,因此我可以拥有一个登台服务器但是仍然遇到以下错误。

我已删除了' sqlite3'我的宝石文件中的宝石,并确保' pg' gem目前已安装并且还将我的database.yml更改为以下内容...但仍然收到sqlite3错误。有什么建议吗?

development:
adapter: postgresql
encoding: unicode
database: app-name
pool: 5
port: 5432
host: localhost

test:
adapter: postgresql
encoding: unicode
database: app-name
pool: 5
port: 5432
host: localhost

Gem :: Installer :: ExtensionBuildError:错误:无法构建gem原生扩展。

   /tmp/build_a4c50f3d-ca0b-4757-b846-70093165281e/vendor/ruby-2.0.0/bin/ruby extconf.rb
   checking for sqlite3.h... no
   sqlite3.h is missing. Try 'port install sqlite3 +universal',
   'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
   and check your shared library search path (the
   location where your sqlite3 shared library is located).
   *** extconf.rb failed ***
   Could not create Makefile due to some reason, probably lack of necessary
   libraries and/or headers.  Check the mkmf.log file for more details.  You may
   need configuration options.

   Provided configuration options:
   --with-opt-dir
   --without-opt-dir
   --with-opt-include
   --without-opt-include=${opt-dir}/include
   --with-opt-lib
   --without-opt-lib=${opt-dir}/lib
   --with-make-prog
   --without-make-prog
   --srcdir=.
   --curdir
   --ruby=/tmp/build_a4c50f3d-ca0b-4757-b846-70093165281e/vendor/ruby-2.0.0/bin/ruby
   --with-sqlite3-dir
   --without-sqlite3-dir
   --with-sqlite3-include
   --without-sqlite3-include=${sqlite3-dir}/include
   --with-sqlite3-lib
   --without-sqlite3-lib=${sqlite3-dir}/
   --enable-local
   --disable-local


   Gem files will remain installed in /tmp/build_a4c50f3d-ca0b-4757-b846-70093165281e/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.9 for inspection.
   Results logged to /tmp/build_a4c50f3d-ca0b-4757-b846-70093165281e/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.9/ext/sqlite3/gem_make.out
   Installing transitions (0.1.11)
   Installing pg (0.17.0)
   Installing ffi (1.9.3)
   An error occurred while installing sqlite3 (1.3.9), and Bundler cannot continue.
   Make sure that `gem install sqlite3 -v '1.3.9'` succeeds before bundling.

!  !无法通过Bundler安装gem。  !  !检测到Heroku不支持的sqlite3 gem。  ! https://devcenter.heroku.com/articles/sqlite3  !

!推送拒绝,无法编译Ruby应用程序

1 个答案:

答案 0 :(得分:0)

我也得到了同样的错误信息。我通过编辑Sublime Text 2 Editor中的Activerecord / Activesupport gems解决了这个问题。我用postgresql替换了sqlite3。但是必须确保已经下载并安装了相应版本的postgresql。错误消息是开发人员最好的朋友。学习阅读并理解错误消息。一开始很令人沮丧,但实际上,你最好的朋友和好老师。谢谢大家。