Heroku:推送被拒绝,无法编译 Ruby 应用程序

2024-01-01

我已经被困了一个星期试图解决这个问题。我目前一直在关注在线讲座,但是我完全遵循了所有内容,并且讲师并没有真正提供任何帮助。每当我尝试推送到 heroku 时,我都会收到以下信息:

初始化存储库,完成。 数物体:85,完成。 增量压缩最多使用 2 个线程。 压缩对象:100% (76/76),完成。 写入对象:100% (85/85),27.36 KiB,完成。 总计 85 个(增量 6),重复使用 0 个(增量 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 [email protected] /cdn-cgi/l/email-protection:tranquil-ridge-7489.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected] /cdn-cgi/l/email-protection:tranquil-ridge-7489.git'

我尝试按照之前问题的解决方案重建 gem 文件,删除 gemfile.lock 并运行捆绑安装程序,但我仍然收到此错误。

这是我当前的 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

对此有什么帮助吗?


我会推荐一些东西:

1)按照说明进行操作here https://devcenter.heroku.com/articles/bundler-windows-gemfile来处理Gemfile部署在 Windows 上生成的 Ruby 项目时出现的问题。

2) 在 Gemfile 中执行以下操作

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

group :development do
  gem 'sqlite3'
end

这样就摆脱了sqlite3来自您的生产部署。使用它进行单元和集成测试,但使用 PostgreSQL 进行验收/功能测试,因为这是 Heroku 上选择的 RDBMS。另外,每个宝石仅参考一次。

3) 设置PostgreSQL 附加组件的 Hobby Dev 版本 https://addons.heroku.com/heroku-postgresql在 Heroku 上的部署环境中。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Heroku:推送被拒绝,无法编译 Ruby 应用程序 的相关文章

随机推荐

  • 清除 MATLAB 中的类定义

    命令clear classes清除当时加载到内存中的所有类定义 是否可以仅清除特定的类定义 编辑 我有兴趣删除特定的课程定义来自内存 而不是类实例 当我编写新的 HPF 类时 我自己也遇到了这个问题 所以我尝试了一些事情 因为当我调试新类时
  • CI/CD 的 Helm 图表版本

    我为 CI CD 管道设置了一个 helm 存储库 但我遇到的一件事是 helm 的版本控制系统 该系统专注于语义版本控制系统 如下所示x x x 我希望能够指定 暂存 最新 和 生产 等标签 尽管我能够成功上传带有字符串版本的图表 NAM
  • 全文搜索和 Python

    有人可以帮我推荐一个支持 Python 的全文搜索引擎吗 现在我们已经有了一个 MySQL 数据库 我想添加一个功能 让全文搜索引擎索引该数据库中某些表中的某些文本 Web 应用程序将使用此文本数据来搜索数据库中的相应记录 例如 在客户表中
  • 正则表达式匹配非行首

    我有以下 XML 标签
  • Jquery .serialize() 不处理下拉列表的值?

    我认为这应该是一件简单的事情 但由于某种原因 除了下拉列表的选定值之外 我的所有表单值都被很好地序列化 表单如下
  • C#.net 将带有附件的电子邮件排队发送的最佳方法

    我正在寻找一种更安全地从我们的应用程序发送电子邮件的方法 目前 我们直接将电子邮件发送到 IIS SMTP 服务器 但正在寻找在服务器出现故障 重新启动等情况下更安全地传送电子邮件的方法 我正在考虑实现此目的的一种方法是将电子邮件 带有附件
  • AttributeError:“AuthorizedSession”对象没有属性“configure_mtls_channel”

    我正在使用 Cloud Composer 编排两个数据流作业 并且一个月以来运行良好 突然 这两个作业停止工作 并出现以下错误消息 在 download blob 文件中 usr local lib python3 6 site packa
  • 更改 MKMapView 的地图类型

    我正在尝试开发一个界面 供用户更改mapType 视图 我想通过在地图视图的右下角添加折叠效果来实现这一点 用户可以在右下角按下或按下并拖动 地图将折叠起来足以显示 3 种不同的地图类型 常规 混合和卫星 这与 iPhone 上的谷歌地图具
  • Bootstrap JS 函数未在 Rails 6/Webpacker 中加载

    使用 Webpacker 和 Rails 6 攀登学习曲线 我已经使用 Yarn 和 Webpack 安装了 Bootstrap 4 当我尝试在浏览器的 JS 控制台中使用 Bootstrap 组件时 我得到 TypeError fn bu
  • Twitter BootStrap 模态窗口后备链接

    我正在使用 Twitter Bootstrap 模式窗口 以防万一模态窗口由于 js 错误而无法工作 有一个后备页面 如果模式窗口未加载 如何确保页面已加载 打开模态窗口的链接 a href login modal Login a 模态窗口
  • 如何将本地文件夹连接到 Git 存储库并开始在分支上进行更改?

    我是源代码管理新手 过去 我手动备份文件副本并对克隆进行更改 然后在调试后将更改手动传输到主文件 我意识到这类似于分支与 Git 存储库的工作方式 但我从未使用过 我下载了 Git 并在 GitLab 上注册了一个帐户 并开始了一个新项目
  • Haxe——像 ActionScript 一样嵌入文件?

    在 ActionScript 中 您可以执行以下操作 Embed source src myfile xml mimeType application octet stream private var xml Class 它会嵌入您的文件以
  • 先前操作未完成的问题

    我对 Linux 相当陌生 我正在尝试安装 openCV 软件 我正在安装一些东西 突然断电并且中断了 当我重新安装它时 我不断收到此错误 svn E155037 Previous operation has not finished ru
  • 使用 argparse 调用函数[重复]

    这个问题在这里已经有答案了 我在从 argpars 调用函数时遇到问题 这是我的脚本的简化版本 可以打印我给 s 或 p 的任何值 import argparse def main parser argparse ArgumentParse
  • 如何用 JavaScript 创建一个猜数字游戏?

    我需要创建一个猜数游戏 使用它接收一个值document getElementById并将其输出到
  • 将文件上传到Google存储而不将其保存到内存

    我想将文件从前端直接通过后端上传到Google存储桶中 而不是先将其完全保存在服务器的内存中 我添加了一个类似于以下的端点example https cloud google com go getting started using clo
  • 如何从akka actor获取消息队列的大小?

    应用程序中有Akka Java API 参与者 UntypeActor 和消息 根据API合同 如果几条消息发送给同一个参与者 它们将被一一排队和处理 我想根据队列大小处理参与者中的消息 基本上 在 Actor onReceive 中处理当
  • 将图像数据从 Java 传递到接受指针的 C Native 函数

    我在外部 so 文件中提供了一个 C 函数 该函数将图像数据作为输入 并提供压缩图像以及图像长度作为输出 函数模板如下 char OutputImage CompressImage char InputImage int lenOutIma
  • VB.NET 中带有 = 的奇怪 Case 语句

    在我们的一个班级中找到了这段代码 但我不明白第一个 case 语句在做什么 Case i 1 我确信有人只是错误地从 IF ELSE 语句转换了它 但为什么 VB NET 允许这种语法 这样写是什么意思呢 Dim i As Integer
  • Heroku:推送被拒绝,无法编译 Ruby 应用程序

    我已经被困了一个星期试图解决这个问题 我目前一直在关注在线讲座 但是我完全遵循了所有内容 并且讲师并没有真正提供任何帮助 每当我尝试推送到 heroku 时 我都会收到以下信息 初始化存储库 完成 数物体 85 完成 增量压缩最多使用 2