部署应用程序时出现错误消息

时间:2015-05-26 14:02:51

标签: ruby-on-rails postgresql heroku sqlite

我是Ruby on Rails的新手。执行Michael Hartl的Ruby on Rails教程。

我使用Cloud 9作为主机,使用Bitbucket进行版本控制,并通过Heroku进行部署。 我试图将Postgresql安装到我的项目而不是sqlite3,因为我知道Heroku需要它。但不知何故,在我的文件中某处我失败了。

有人可以帮忙吗?

当我跑步时:

$ git push heroku master

我收到此错误:

remote:        Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
remote:
remote:        /tmp/build_169ab9dc473338103fb7830819856f04/vendor/ruby-2.0.0/bin/ruby extconf.rb
remote:        checking for sqlite3.h... no
remote:        sqlite3.h is missing. Try 'port install sqlite3 +universal',
remote:        'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
remote:        and check your shared library search path (the
remote:        location where your sqlite3 shared library is located).
remote:        *** extconf.rb failed ***
remote:        Could not create Makefile due to some reason, probably lack of necessary
remote:        libraries and/or headers.  Check the mkmf.log file for more details.  You may
remote:        need configuration options.
remote:
remote:        Provided configuration options:
remote:        --with-opt-dir
remote:        --without-opt-dir
remote:        --with-opt-include
remote:        --without-opt-include=${opt-dir}/include
remote:        --with-opt-lib
remote:        --without-opt-lib=${opt-dir}/lib
remote:        --with-make-prog
remote:        --without-make-prog
remote:        --srcdir=.
remote:        --curdir
remote:        --ruby=/tmp/build_169ab9dc473338103fb7830819856f04/vendor/ruby-2.0.0/bin/ruby
remote:        --with-sqlite3-dir
remote:        --without-sqlite3-dir
remote:        --with-sqlite3-include
remote:        --without-sqlite3-include=${sqlite3-dir}/include
remote:        --with-sqlite3-lib
remote:        --without-sqlite3-lib=${sqlite3-dir}/
remote:
remote:
remote:        Gem files will remain installed in /tmp/build_169ab9dc473338103fb7830819856f04/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.10 for inspection.
remote:        Results logged to /tmp/build_169ab9dc473338103fb7830819856f04/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.10/ext/sqlite3/gem_make.out
remote:        An error occurred while installing sqlite3 (1.3.10), and Bundler cannot
remote:        continue.
remote:        Make sure that `gem install sqlite3 -v '1.3.10'` succeeds before bundling.
remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !
remote:  !     Detected sqlite3 gem which is not supported on Heroku.
remote:  !     https://devcenter.heroku.com/articles/sqlite3
remote:  !
remote:
remote:  !     Push rejected, failed to compile Ruby app
remote:
remote: Verifying deploy....
remote:
remote: !       Push rejected to stormy-shelf-7526.
remote:
To https://git.heroku.com/stormy-shelf-7526.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to.....

1 个答案:

答案 0 :(得分:0)

如错误所述,您无法在Heroku上使用sqlite3

错误意味着您的Gemfile包含sqlite3作为生产捆绑过程的一部分。您需要做的是将sqlite3包裹在development和/或test组中,并确保在这些组之外拥有pg gem。