Heroku:推送被拒绝,未能编译Ruby应用程序 [英] Heroku: Push rejected, failed to compile Ruby app

查看:248
本文介绍了Heroku:推送被拒绝,未能编译Ruby应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图弄清楚这一点,我一直坚持了一个星期。我目前一直在关注在线讲座,但是我完全遵循了一切,讲师并没有任何帮助。每当我尝试推送到heroku时,我都会收到以下内容:


初始化存储库,完成。
计数对象:85,完成。
使用多达2个线程的增量压缩。
压缩对象:100%(76/76),完成。
写作对象:100%(85/85),27.36 KiB,完成。
共计85(delta 6),重用0(delta 0)

  -----> Ruby应用检测到
----->编译Ruby / Rails
----->使用Ruby版本:ruby-2.0.0
----->警告:
删除`Gemfile.lock`,因为它是在Windows上生成的。
Bundler会做一个完整的解决方案,以便正确处理原生宝石。
这可能会导致应用程序使用意外的宝石版本。
在极少数情况下,Bundler可能无法解决您的依赖项
全部。
https://devcenter.heroku.com/articles/bundler-windows-gemfile
----->使用Bundler版本1.5.2安装依赖关系
检测到新应用程序加载默认打包程序缓存
运行:bundle install - 无需开发:test --path vendor / bundl
-binstubs vendor / bundle / bin -j4
您的Gemfile不止一次地列出了gem sqlite3(> = 0)。
您应该只保留其中一个。
虽然现在不存在问题,但如果稍后更改其中一个
的话,可能会导致错误。
您的Gemfile不止一次地列出了gem sqlite3(> = 0)。
您应该只保留其中一个。
虽然现在不存在问题,但如果稍后更改其中一个
的话,可能会导致错误。
您的Gemfile不止一次地列出gem rspec-rails(= 2.6.1)。
您应该只保留其中一个。
虽然现在不存在问题,但如果稍后更改其中一个
的话,可能会导致错误。
从https://rubygems.org/ .........
获取gem元数据从https://rubygems.org/获取额外的元数据..
解决依赖关系。 ..
使用builder(3.0.4)
使用erubis(2.7.0)
使用journey(1.0.4)
使用rack(1.4.5)
使用hike(1.2.3)
使用tilt(1.4.1)
安装i18n(0.6.1)
使用polyglot(0.3.3)
安装MIME类型(1.25 .1)
使用tzinfo(0.3.38)
使用bundler(1.5.2)
使用coffee-script-source(1.6.3)
使用execjs(2.0.2 )
使用json(1.8.1)
使用thor(0.18.1)
安装multi_json(1.8.4)
安装rake(10.1.1)
安装arel(3.0.3)
使用rack-cache(1.2)
使用rack-test(0.6.2)
使用rack-ssl(1.3.3)
使用treetop 1.4.15)
使用coffee-script(2.2.0)
使用rdoc(3.12.2)
安装sass(3.2.13)
安装uglifier(2.4.0)
使用链轮(2.2.2)
使用邮件(2.5.4 )
Gem :: Installer :: ExtensionBuildError:错误:无法构建gem原生
张力。
/tmp/build_903734dc-f591-44eb-8891-428ba3caf9e0/vendor/ruby-2.0.0/bin/ $ b $由extconf.rb
检查sqlite3.h ... no
sqlite3.h丢失。试试'port install sqlite3 + universal'
或'yum install sqlite-devel'并检查你的共享库搜索pat
你的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_903734dc-f591-44eb-8891-428ba3caf9e0 / vendor / ruby​​-2.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文件将保持安装in / tmp / build_903734dc-f591-44eb-8891-
ba3caf9e0 / vendor / bundle / ruby​​ / 2.0.0 / gems / sqlite3-1.3.8进行检查。
将结果记录到/ tmp / build_903734dc-f591-44eb-8891-428ba3caf9e0 / vend
bundle / ruby​​ / 2.0.0 / gems / sqlite3-1.3.8 / ext / sqlite3 / gem_make.out
安装activesupport(3.2.13)
安装pg(0.17.1)
安装sqlite3(1.3.8)时发生错误,并且Bundler不能
ntinue。
确保gem install sqlite3 -v'1.3.8'`在bundli

之前成功了Bundler输出:您的Gemfile比$ b更多地列出了gem sqlite3(> = 0)
$ b您应该只保留其中一个。
虽然现在不存在问题,但如果稍后更改其中一个
的话,可能会导致错误。
您的Gemfile不止一次地列出了gem sqlite3(> = 0)。
您应该只保留其中一个。
虽然现在不存在问题,但如果稍后更改其中一个
的话,可能会导致错误。
您的Gemfile不止一次地列出gem rspec-rails(= 2.6.1)。
您应该只保留其中一个。
虽然现在不存在问题,但如果稍后更改其中一个
的话,可能会导致错误。
从https://rubygems.org/ .........
获取gem元数据从https://rubygems.org/获取额外的元数据..
解决依赖关系。 ..
使用builder(3.0.4)
使用erubis(2.7.0)
使用journey(1.0.4)
使用rack(1.4.5)
使用hike(1.2.3)
使用tilt(1.4.1)
安装i18n(0.6.1)
使用polyglot(0.3.3)
安装MIME类型(1.25 .1)
使用tzinfo(0.3.38)
使用bundler(1.5.2)
使用coffee-script-source(1.6.3)
使用execjs(2.0.2 )
使用json(1.8.1)
使用thor(0.18.1)
安装multi_json(1.8.4)
安装rake(10.1.1)
安装arel(3.0.3)
使用rack-cache(1.2)
使用rack-test(0.6.2)
使用rack-ssl(1.3.3)
使用treetop 1.4.15)
使用coffee-script(2.2.0)
使用rdoc(3.12.2)
安装sass(3.2.13)
安装uglifier(2.4.0)
使用链轮(2.2.2)
使用邮件(2.5.4 )

Gem :: Installer :: ExtensionBuildError:错误:无法构建gem原生
张力。

/tmp/build_903734dc-f591-44eb-8891-428ba3caf9e0/vendor/ruby-2.0.0/bin/ $ b $由extconf.rb
检查sqlite3.h ...没有
sqlite3.h缺失。试试'port install sqlite3 + universal'
或'yum install sqlite-devel'并检查你的共享库搜索pat
你的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_903734dc-f591-44eb-8891-428ba3caf9e0 / vendor / ruby​​-2.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} /
- 启用本地
- 禁用本地


Gem文件将保留安装在/ tmp / build_903734dc-f591-44eb-8891-
ba3caf9e0 / vendor / bundle / ruby​​ / 2.0.0 / gems / sqlite3-1.3.8中进行检查。
将结果记录到/ tmp / build_903734dc-f591-44eb-8891-428ba3caf9e0 / vend
bundle / ruby​​ / 2.0.0 / gems / sqlite3-1.3.8 / ext / sqlite3 / gem_make.out
安装activesupport(3.2.13)
安装pg(0.17.1)
安装sqlite3(1.3.8)时发生错误,并且Bundler不能
ntinue。
确保gem install sqlite3 -v'1.3.8'`在bundli

之前成功!
!无法通过Bundler安装宝石。

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


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

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


我试着重建gem文件,删除gemfile.lock并运行bundle安装程序,解决了以前的问题,但我仍然得到这个错误。



这是我目前的gemFile:

  source' https://rubygems.org'

gem'rails','3.2.13'

#Bundle edge Rails改为:
#gem'rails', :git => 'git://github.com/rails/rails.git'

gem'sqlite3'


#仅用于资产而不需要的宝石
#在生产环境中默认。
group:assets do
gem'sass-rails','〜> 3.2.3'
gem'咖啡栏','〜> 3.2.1'

#请参阅https://github.com/sstephenson/execjs#readme了解更多受支持的运行时间
#gem'therubyracer',:platforms => :ruby

gem'uglifier','> = 1.0.3'
结束

gem'jquery-rails'

#使用ActiveModel has_secure_password
#gem'bcrypt-ruby','〜> 3.0.0'

#为JSON使用Jbuilder模板
#gem'jbuilder'

使用独角兽作为应用服务器
#gem' unicorn'

#使用Capistrano进行部署
#gem'capistrano'

#使用调试器
#gem'debugger'

group:development do
gem'sqlite3'
gem'rspec-rails','2.6.1',:require => 'rspec-rails'
gem'faker','0.3.1'
end

group:test do
gem'sqlite3'
gem' rspec-rails','2.6.1',:require => 'rpec-rails'
gem'webrat','0.7.1'
gem'factory_girl_rails','1.0'
gem'turn',:require => false
end

group:production do
gem'pg'
end

对此有何帮助?

解决方案

我会推荐几件事情:
$ b 1) 此处的说明来处理 Gemfile 问题在部署在Windows上生成的Ruby项目时出现。



2)在您的Gemfile中执行以下操作

  group:test::production do 
gem'pg'
end

group:development do
gem'sqlite3'
结束

这样可以避免 sqlite3 从您的生产部署。使用它进行单元和集成测试,但使用PostgreSQL进行验收/功能测试,因为这是Heroku所选择的RDBMS。 3)设置 nofollow> Hobbyoku版本的PostgreSQL附加组件在Heroku的部署环境中。


I have been stuck for a week trying to figure this out. I have currently been following online lectures, however I followed everything exactly, and the instructor isn't really of any help. Whenever I try to push to heroku I receive the following:

Initializing repository, done. Counting objects: 85, done. Delta compression using up to 2 threads. Compressing objects: 100% (76/76), done. Writing objects: 100% (85/85), 27.36 KiB, done. Total 85 (delta 6), reused 0 (delta 0)

-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Warning:
       Removing `Gemfile.lock` because it was generated on Windows.
       Bundler will do a full resolve so native gems are handled properly.
       This may result in unexpected gem versions being used in your app.
       In rare occasions Bundler may not be able to resolve your dependencies
 all.
       https://devcenter.heroku.com/articles/bundler-windows-gemfile
-----> Installing dependencies using Bundler version 1.5.2
       New app detected loading default bundler cache
       Running: bundle install --without development:test --path vendor/bundl
-binstubs vendor/bundle/bin -j4
       Your Gemfile lists the gem sqlite3 (>= 0) more than once.
       You should probably keep only one of them.
       While it's not a problem now, it could cause errors if you change the
sion of just one of them later.
       Your Gemfile lists the gem sqlite3 (>= 0) more than once.
       You should probably keep only one of them.
       While it's not a problem now, it could cause errors if you change the
sion of just one of them later.
       Your Gemfile lists the gem rspec-rails (= 2.6.1) more than once.
       You should probably keep only one of them.
       While it's not a problem now, it could cause errors if you change the
sion of just one of them later.
       Fetching gem metadata from https://rubygems.org/.........
       Fetching additional metadata from https://rubygems.org/..
       Resolving dependencies...
       Using builder (3.0.4)
       Using erubis (2.7.0)
       Using journey (1.0.4)
       Using rack (1.4.5)
       Using hike (1.2.3)
       Using tilt (1.4.1)
       Installing i18n (0.6.1)
       Using polyglot (0.3.3)
       Installing mime-types (1.25.1)
       Using tzinfo (0.3.38)
       Using bundler (1.5.2)
       Using coffee-script-source (1.6.3)
       Using execjs (2.0.2)
       Using json (1.8.1)
       Using thor (0.18.1)
       Installing multi_json (1.8.4)
       Installing rake (10.1.1)
       Installing arel (3.0.3)
       Using rack-cache (1.2)
       Using rack-test (0.6.2)
       Using rack-ssl (1.3.3)
       Using treetop (1.4.15)
       Using coffee-script (2.2.0)
       Using rdoc (3.12.2)
       Installing sass (3.2.13)
       Installing uglifier (2.4.0)
       Using sprockets (2.2.2)
       Using mail (2.5.4)
       Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native
tension.
       /tmp/build_903734dc-f591-44eb-8891-428ba3caf9e0/vendor/ruby-2.0.0/bin/
y 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 pat
the
       location where your sqlite3 shared library is located).
       *** extconf.rb failed ***
       Could not create Makefile due to some reason, probably lack of necessa
       libraries and/or headers.  Check the mkmf.log file for more details.
 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_903734dc-f591-44eb-8891-428ba3caf9e0/vendor/ruby-2.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_903734dc-f591-44eb-8891-
ba3caf9e0/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.8 for inspection.
       Results logged to /tmp/build_903734dc-f591-44eb-8891-428ba3caf9e0/vend
bundle/ruby/2.0.0/gems/sqlite3-1.3.8/ext/sqlite3/gem_make.out
       Installing activesupport (3.2.13)
       Installing pg (0.17.1)
       An error occurred while installing sqlite3 (1.3.8), and Bundler cannot
ntinue.
       Make sure that `gem install sqlite3 -v '1.3.8'` succeeds before bundli

       Bundler Output: Your Gemfile lists the gem sqlite3 (>= 0) more than on

       You should probably keep only one of them.
       While it's not a problem now, it could cause errors if you change the
sion of just one of them later.
       Your Gemfile lists the gem sqlite3 (>= 0) more than once.
       You should probably keep only one of them.
       While it's not a problem now, it could cause errors if you change the
sion of just one of them later.
       Your Gemfile lists the gem rspec-rails (= 2.6.1) more than once.
       You should probably keep only one of them.
       While it's not a problem now, it could cause errors if you change the
sion of just one of them later.
       Fetching gem metadata from https://rubygems.org/.........
       Fetching additional metadata from https://rubygems.org/..
       Resolving dependencies...
       Using builder (3.0.4)
       Using erubis (2.7.0)
       Using journey (1.0.4)
       Using rack (1.4.5)
       Using hike (1.2.3)
       Using tilt (1.4.1)
       Installing i18n (0.6.1)
       Using polyglot (0.3.3)
       Installing mime-types (1.25.1)
       Using tzinfo (0.3.38)
       Using bundler (1.5.2)
       Using coffee-script-source (1.6.3)
       Using execjs (2.0.2)
       Using json (1.8.1)
       Using thor (0.18.1)
       Installing multi_json (1.8.4)
       Installing rake (10.1.1)
       Installing arel (3.0.3)
       Using rack-cache (1.2)
       Using rack-test (0.6.2)
       Using rack-ssl (1.3.3)
       Using treetop (1.4.15)
       Using coffee-script (2.2.0)
       Using rdoc (3.12.2)
       Installing sass (3.2.13)
       Installing uglifier (2.4.0)
       Using sprockets (2.2.2)
       Using mail (2.5.4)

       Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native
tension.

       /tmp/build_903734dc-f591-44eb-8891-428ba3caf9e0/vendor/ruby-2.0.0/bin/
y 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 pat
the
       location where your sqlite3 shared library is located).
       *** extconf.rb failed ***
       Could not create Makefile due to some reason, probably lack of necessa
       libraries and/or headers.  Check the mkmf.log file for more details.
 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_903734dc-f591-44eb-8891-428ba3caf9e0/vendor/ruby-2.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_903734dc-f591-44eb-8891-
ba3caf9e0/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.8 for inspection.
       Results logged to /tmp/build_903734dc-f591-44eb-8891-428ba3caf9e0/vend
bundle/ruby/2.0.0/gems/sqlite3-1.3.8/ext/sqlite3/gem_make.out
       Installing activesupport (3.2.13)
       Installing pg (0.17.1)
       An error occurred while installing sqlite3 (1.3.8), and Bundler cannot
ntinue.
       Make sure that `gem install sqlite3 -v '1.3.8'` succeeds before bundli

 !
 !     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 app

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

I have tried rebuilding the gem files, deleting gemfile.lock and running bundle installer, following solution from previous questions, but I am still getting this error.

Here is my current gemFile:

source 'https://rubygems.org'

gem 'rails', '3.2.13'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'

group :development do
    gem 'sqlite3'
    gem 'rspec-rails', '2.6.1', :require => 'rspec-rails'
    gem 'faker', '0.3.1'
end

group :test do
    gem 'sqlite3'
    gem 'rspec-rails', '2.6.1', :require => 'rpec-rails'
    gem 'webrat', '0.7.1'
    gem 'factory_girl_rails', '1.0'
    gem 'turn', :require => false
end

group :production do
    gem 'pg'
end

Any help on this?

解决方案

I would recommend a few things:

1) Follow the instructions here to deal with the Gemfile issues that arise when deploying a Ruby project generated on Windows.

2) Do the following in your Gemfile

group :test, :production do
  gem 'pg'
end

group :development do
  gem 'sqlite3'
end

This gets rid of sqlite3 from your production deployment. Use it for unit and integration testing, but use PostgreSQL for acceptance/functional testing because that's the RDBMS of choice on Heroku. Also, reference your gems only once each.

3) Set up the Hobby Dev version of the PostgreSQL add-on in your deployment environment on Heroku.

这篇关于Heroku:推送被拒绝,未能编译Ruby应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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