无法将Git repo项目部署到Heroku中 [英] Unable to deploy Git repo project into Heroku

查看:102
本文介绍了无法将Git repo项目部署到Heroku中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照以下步骤操作:

  git clone git://github.com/heroku/ruby-sample.git 
cd ruby​​-sample
heroku创建
git push heroku master
heroku open

当我试图运行第四步时,我得到了以下错误:

  $ git push heroku master 
警告:将IP地址'50 .19.85.156'的RSA主机密钥永久添加到已知主机列表中。
计数对象:63,完成。
使用多达4个线程的增量压缩。
压缩对象:100%(49/49),完成。
写作对象:100%(63/63),25.99 KiB | 0字节/秒,完成。
总计63(增量2),重用0(增量0)

-----> Ruby / Rails应用程序检测到
----->使用Ruby版本:ruby-2.0.0
----->使用Bundler版本1.3.2安装依赖项
运行:bundle install --without development:test --path vendor / bundle --binstubs vendor / bundle / bin --deployment
从https获取gem元数据:/ /rubygems.org/ .........
从https://rubygems.org/获取gem元数据..
安装rake(10.1.0)
安装i18n( 0.6.5)
安装multi_json(1.7.9)
安装activesupport(3.2.14)
安装构建器(3.0.4)
安装activemodel(3.2.14)
安装erubis(2.7.0)
安装旅程(1.0.4)
安装机架(1.4.5)
安装机架高速缓存(1.2)
安装机架测试(0.6.2)
安装远足(1.2.3)
安装倾斜(1.4.1)
安装链轮(2.2.2)
安装actionpack(3.2.14)
安装mime-types(1.24)
安装polyglot(0.3.3)
In (1.4.15)
安装邮件(2.5.4)
安装actionmailer(3.2.14)
安装arel(3.0.2)
安装tzinfo(0.3.37) )
安装activerecord(3.2.14)
安装activeresource(3.2.14)
安装coffee-script-source(1.6.3)
安装execjs(2.0.1)
安装coffee-script(2.2.0)
安装rack-ssl(1.3.3)
安装json(1.8.0)
安装rdoc(3.12.2)
安装thor(0.18.1)
安装railties(3.2.14)
安装咖啡栏(3.2.2)
安装jquery-rails(3.0.4)
使用Bundle(1.3.2)
安装rails(3.2.14)
安装sass(3.2.10)
安装sass-rails(3.2.6)
安装sqlite3(1.3。 8)
Gem :: Installer :: ExtensionBuildError:错误:无法构建gem本机扩展。
/tmp/build_2wj8rtu1t0j1d/vendor/ruby-2.0.0/bin/ruby extconf.rb
检查sqlite3.h ...没有
sqlite3.h缺失。试试'port install sqlite3 + universal'
或'yum install sqlite-devel'并检查你的共享库搜索路径(sqlite3共享库所在的
位置)。
*** extconf.rb失败***
由于某些原因无法创建Makefile,可能缺少必要的
库和/或头文件。检查mkmf.log文件以获取更多详细信息。您可能
需要配置选项。
提供的配置选项:
--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_2wj8rtu1t0j1d / 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文件将保持安装在/ tmp / build_2wj8rtu1t0j1d / vendor / bundle /ruby/2.0.0/gems/sqlite3-1.3.8进行检查。
记录到/tmp/build_2wj8rtu1t0j1d/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.8/ext/sqlite3/gem_make.out
的结果安装sqlite3时出错(1.3。 8)和Bundler无法继续。
确保`gem install sqlite3 -v'1.3.8'`捆绑成功。
Bundler输出:从https://rubygems.org / .........
获取gem元数据从https://rubygems.org/获取gem元数据..
安装rake(10.1.0)
安装i18n(0.6.5)
安装multi_json(1.7.9)
安装activesupport(3.2.14)
安装构建器(3.0.4 )
安装activemodel(3.2.14)
安装erubis(2.7.0)
安装旅程(1.0.4)
安装机架(1.4.5)
安装rack-cache(1.2)
安装机架测试(0.6.2)
安装远程(1.2.3)
安装倾斜(1.4.1)
安装链轮(2.2。 2)
安装actionpack(3.2.14)
安装mime-types(1.24)
安装polyglot(0.3.3)
安装树枝(1.4.15)
安装邮件(2.5.4)
安装actionmailer(3.2.14)
安装arel(3.0.2)
安装tzinfo(0.3.37)
安装activerecord(3.2.14)
安装activeresource(3.2.14)
安装coffee-script-source(1.6.3)
安装execjs (2.0.1)
安装coffee-script(2.2.0)
安装rack-ssl(1.3.3)
安装json(1.8.0)
安装rdoc(3.12 .2)
安装thor(0.18.1)
安装railties(3.2.14)
安装咖啡栏(3.2.2)
安装jquery-rails(3.0.4 )
使用bundler(1.3.2)
安装rails(3.2.14)
安装sass(3.2.10)
安装sass-rails(3.2.6)
安装sqlite3(1.3.8)
Gem :: Installer :: ExtensionBuildError:错误:无法构建gem本机扩展。

/tmp/build_2wj8rtu1t0j1d/vendor/ruby-2.0.0/bin/ruby extconf.rb
检查sqlite3.h ...没有
sqlite3.h丢失。试试'port install sqlite3 + universal'
或'yum install sqlite-devel'并检查你的共享库搜索路径(sqlite3共享库所在的
位置)。
*** extconf.rb失败***
由于某些原因无法创建Makefile,可能缺少必要的
库和/或头文件。检查mkmf.log文件以获取更多详细信息。您可能
需要配置选项。

提供的配置选项:
--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_2wj8rtu1t0j1d / 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文件将保持安装在/tmp/build_2wj8rtu1t0j1d/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.8进行检查。
记录到/tmp/build_2wj8rtu1t0j1d/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.8/ext/sqlite3/gem_make.out
的结果安装sqlite3时出错(1.3。 8)和Bundler无法继续。
确保`gem install sqlite3 -v'1.3.8'`捆绑成功。

!无法通过Bundler安装宝石。

!检测到Heroku不支持的sqlite3 gem。
! https://devcenter.heroku.com/articles/sqlite3


!推送被拒绝,未能编译Ruby / Rails应用程序

到git@heroku.com:shrouded-brushlands-7248.git
! [remote rejected] master - > master(pre-receive hook refused)
错误:未能将某些参考文献推送到'git@heroku.com:shrouded-brushlands-7248.git'

任何一个人都可以帮我部署吗?

你的问题是 sqlite3 gem:

 安装sqlite3时发生错误(1.3.8 )和Bundler无法继续。 

您必须将 pg gem添加到您的 Gemfile 位于 production 组中,因为Heroku使用PostgreSQL。



您可以在开发测试中继续使用 sqlite3 > groups。

  group:production do 
gem'pg'
end

group:development,:test do
gem'sqlite3'
end

更多信息: https://devcenter.heroku.com/articles/heroku-postgresql#connecting -in-ruby


I have followed below steps:

git clone git://github.com/heroku/ruby-sample.git
cd ruby-sample
heroku create
git push heroku master
heroku open

When I'm trying to run the 4th step I'm getting below error:

$ git push heroku master
Warning: Permanently added the RSA host key for IP address '50.19.85.156' to the list of known hosts.
Counting objects: 63, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (49/49), done.
Writing objects: 100% (63/63), 25.99 KiB | 0 bytes/s, done.
Total 63 (delta 2), reused 0 (delta 0)

-----> Ruby/Rails app detected
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using Bundler version 1.3.2
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
       Fetching gem metadata from https://rubygems.org/.........
       Fetching gem metadata from https://rubygems.org/..
       Installing rake (10.1.0)
       Installing i18n (0.6.5)
       Installing multi_json (1.7.9)
       Installing activesupport (3.2.14)
       Installing builder (3.0.4)
       Installing activemodel (3.2.14)
       Installing erubis (2.7.0)
       Installing journey (1.0.4)
       Installing rack (1.4.5)
       Installing rack-cache (1.2)
       Installing rack-test (0.6.2)
       Installing hike (1.2.3)
       Installing tilt (1.4.1)
       Installing sprockets (2.2.2)
       Installing actionpack (3.2.14)
       Installing mime-types (1.24)
       Installing polyglot (0.3.3)
       Installing treetop (1.4.15)
       Installing mail (2.5.4)
       Installing actionmailer (3.2.14)
       Installing arel (3.0.2)
       Installing tzinfo (0.3.37)
       Installing activerecord (3.2.14)
       Installing activeresource (3.2.14)
       Installing coffee-script-source (1.6.3)
       Installing execjs (2.0.1)
       Installing coffee-script (2.2.0)
       Installing rack-ssl (1.3.3)
       Installing json (1.8.0)
       Installing rdoc (3.12.2)
       Installing thor (0.18.1)
       Installing railties (3.2.14)
       Installing coffee-rails (3.2.2)
       Installing jquery-rails (3.0.4)
       Using bundler (1.3.2)
       Installing rails (3.2.14)
       Installing sass (3.2.10)
       Installing sass-rails (3.2.6)
       Installing sqlite3 (1.3.8)
       Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
       /tmp/build_2wj8rtu1t0j1d/vendor/ruby-2.0.0/bin/ruby extconf.rb
       checking for sqlite3.h... no
       sqlite3.h is missing. Try 'port install sqlite3 +universal'
       or 'yum install sqlite-devel' 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_2wj8rtu1t0j1d/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_2wj8rtu1t0j1d/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.8 for inspection.
       Results logged to /tmp/build_2wj8rtu1t0j1d/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.8/ext/sqlite3/gem_make.out
       An error occurred while installing sqlite3 (1.3.8), and Bundler cannot continue.
       Make sure that `gem install sqlite3 -v '1.3.8'` succeeds before bundling.
       Bundler Output: Fetching gem metadata from https://rubygems.org/.........
       Fetching gem metadata from https://rubygems.org/..
       Installing rake (10.1.0)
       Installing i18n (0.6.5)
       Installing multi_json (1.7.9)
       Installing activesupport (3.2.14)
       Installing builder (3.0.4)
       Installing activemodel (3.2.14)
       Installing erubis (2.7.0)
       Installing journey (1.0.4)
       Installing rack (1.4.5)
       Installing rack-cache (1.2)
       Installing rack-test (0.6.2)
       Installing hike (1.2.3)
       Installing tilt (1.4.1)
       Installing sprockets (2.2.2)
       Installing actionpack (3.2.14)
       Installing mime-types (1.24)
       Installing polyglot (0.3.3)
       Installing treetop (1.4.15)
       Installing mail (2.5.4)
       Installing actionmailer (3.2.14)
       Installing arel (3.0.2)
       Installing tzinfo (0.3.37)
       Installing activerecord (3.2.14)
       Installing activeresource (3.2.14)
       Installing coffee-script-source (1.6.3)
       Installing execjs (2.0.1)
       Installing coffee-script (2.2.0)
       Installing rack-ssl (1.3.3)
       Installing json (1.8.0)
       Installing rdoc (3.12.2)
       Installing thor (0.18.1)
       Installing railties (3.2.14)
       Installing coffee-rails (3.2.2)
       Installing jquery-rails (3.0.4)
       Using bundler (1.3.2)
       Installing rails (3.2.14)
       Installing sass (3.2.10)
       Installing sass-rails (3.2.6)
       Installing sqlite3 (1.3.8)
       Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

       /tmp/build_2wj8rtu1t0j1d/vendor/ruby-2.0.0/bin/ruby extconf.rb
       checking for sqlite3.h... no
       sqlite3.h is missing. Try 'port install sqlite3 +universal'
       or 'yum install sqlite-devel' 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_2wj8rtu1t0j1d/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_2wj8rtu1t0j1d/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.8 for inspection.
       Results logged to /tmp/build_2wj8rtu1t0j1d/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.8/ext/sqlite3/gem_make.out
       An error occurred while installing sqlite3 (1.3.8), and Bundler cannot continue.
       Make sure that `gem install sqlite3 -v '1.3.8'` succeeds before bundling.
 !
 !     Failed to install gems via Bundler.
 !     
 !     Detected sqlite3 gem which is not supported on Heroku.
 !     https://devcenter.heroku.com/articles/sqlite3
 !

 !     Push rejected, failed to compile Ruby/Rails app

To git@heroku.com:shrouded-brushlands-7248.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:shrouded-brushlands-7248.git'

Can any one help me deploy?

解决方案

Your problem is with sqlite3 gem:

An error occurred while installing sqlite3 (1.3.8), and Bundler cannot continue. 

You have to add the pg gem to your Gemfile in production group, since Heroku uses PostgreSQL.

You can continue using sqlite3 in your development and test groups.

group :production do
  gem 'pg'
end        

group :development, :test do
  gem 'sqlite3'
end

More info here: https://devcenter.heroku.com/articles/heroku-postgresql#connecting-in-ruby

这篇关于无法将Git repo项目部署到Heroku中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆