質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Ruby on Rails 4

Ruby on Rails4はRubyによって書かれたオープンソースのウェブフレームワークです。 Ruby on Railsは「設定より規約」の原則に従っており、効率的に作業を行うために再開発を行う必要をなくしてくれます。

Q&A

解決済

1回答

1555閲覧

Herokuへのpush時にエラー

lapi

総合スコア58

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Ruby on Rails 4

Ruby on Rails4はRubyによって書かれたオープンソースのウェブフレームワークです。 Ruby on Railsは「設定より規約」の原則に従っており、効率的に作業を行うために再開発を行う必要をなくしてくれます。

0グッド

0クリップ

投稿2017/02/23 19:09

編集2017/02/24 05:13

###前提・実現したいこと
Herokuへpushしたいのですがpush時にエラーが発生してしまいます。

###発生している問題・エラーメッセージ
Herokuへのpush時のエラー

$ git push heroku master -----> Ruby app detected -----> Compiling Ruby/Rails -----> Using Ruby version: ruby-2.2.6 -----> Installing dependencies using bundler 1.13.7 Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment Warning: the running version of Bundler (1.13.7) is older than the version that created the lockfile (1.14.5). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. Fetching gem metadata from https://rubygems.org/.......... 中略 Installing sprockets 3.7.1 Gem::Ext::BuildError: ERROR: Failed to build gem native extension. /tmp/build_010a3852f863275c64ef45a1f435840e/vendor/ruby-2.2.6/bin/ruby -r ./siteconf20170224-220-ztshpy.rb extconf.rb checking for main() in -licui18n... no checking for main() in -licui18n... no *************************************************************************************** *********** icu required (brew install icu4c or apt-get install libicu-dev) *********** *************************************************************************************** *** 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_010a3852f863275c64ef45a1f435840e/vendor/ruby-2.2.6/bin/$(RUBY_BASE_NAME) --with-icu-dir --without-icu-dir --with-icu-include --without-icu-include=${icu-dir}/include --with-icu-lib --without-icu-lib=${icu-dir}/lib --with-icui18nlib --without-icui18nlib --with-icui18nlib --without-icui18nlib extconf failed, exit code 1 Gem files will remain installed in /tmp/build_010a3852f863275c64ef45a1f435840e/vendor/bundle/ruby/2.2.0/gems/charlock_holmes-0.7.3 for inspection. Results logged to /tmp/build_010a3852f863275c64ef45a1f435840e/vendor/bundle/ruby/2.2.0/extensions/x86_64-linux/2.2.0-static/charlock_holmes-0.7.3/gem_make.out An error occurred while installing charlock_holmes (0.7.3), and Bundler cannot continue. Make sure that `gem install charlock_holmes -v '0.7.3'` succeeds before bundling. Bundler Output: Warning: the running version of Bundler (1.13.7) is older than the version that created the lockfile (1.14.5). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. Fetching gem metadata from https://rubygems.org/.......... Fetching version metadata from https://rubygems.org/.. Fetching dependency metadata from https://rubygems.org/. Installing rake 12.0.0 Installing i18n 0.8.1 Installing json 1.8.6 with native extensions Installing minitest 5.10.1 Installing thread_safe 0.3.6 Installing builder 3.2.3 Installing mini_portile2 2.1.0 Installing erubis 2.7.0 Installing rack 1.6.5 Installing mime-types-data 3.2016.0521 Installing arel 6.0.4 Installing execjs 2.7.0 Installing bcrypt 3.1.11 with native extensions Installing sass 3.4.23 Installing cancan 1.6.10 Installing charlock_holmes 0.7.3 with native extensions Installing thor 0.19.4 Installing coderay 1.1.1 Installing coffee-script-source 1.12.2 Installing commonjs 0.2.7 Installing concurrent-ruby 1.0.4 Installing crass 1.0.2 Installing orm_adapter 0.5.0 Installing escape_utils 1.1.1 with native extensions Installing gemoji 3.0.0 Installing rugged 0.26.0b3 with native extensions Installing greenmat 3.2.2.2 with native extensions Installing tilt 2.0.6 Installing multi_json 1.12.1 Installing turbolinks-source 5.0.0 Installing mem 0.1.5 Installing nested_form 0.3.2 Installing pg 0.19.0 with native extensions Using bundler 1.13.7 Installing rails_serve_static_assets 0.0.5 Installing rails_stdout_logging 0.0.5 Installing remotipart 1.3.1 Installing rdoc 4.3.0 Installing redcarpet 2.3.0 with native extensions Installing tzinfo 1.2.2 Installing nokogiri 1.7.0.1 with native extensions Installing rack-test 0.6.3 Installing warden 1.2.7 Installing mime-types 3.1 Installing autoprefixer-rails 6.7.5 Installing uglifier 3.0.4 Installing coffee-script 2.4.1 Installing less 2.6.0 Installing sprockets 3.7.1 Gem::Ext::BuildError: ERROR: Failed to build gem native extension. /tmp/build_010a3852f863275c64ef45a1f435840e/vendor/ruby-2.2.6/bin/ruby -r ./siteconf20170224-220-ztshpy.rb extconf.rb checking for main() in -licui18n... no checking for main() in -licui18n... no *************************************************************************************** *********** icu required (brew install icu4c or apt-get install libicu-dev) *********** *************************************************************************************** *** 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_010a3852f863275c64ef45a1f435840e/vendor/ruby-2.2.6/bin/$(RUBY_BASE_NAME) --with-icu-dir --without-icu-dir --with-icu-include --without-icu-include=${icu-dir}/include --with-icu-lib --without-icu-lib=${icu-dir}/lib --with-icui18nlib --without-icui18nlib --with-icui18nlib --without-icui18nlib extconf failed, exit code 1 Gem files will remain installed in /tmp/build_010a3852f863275c64ef45a1f435840e/vendor/bundle/ruby/2.2.0/gems/charlock_holmes-0.7.3 for inspection. Results logged to /tmp/build_010a3852f863275c64ef45a1f435840e/vendor/bundle/ruby/2.2.0/extensions/x86_64-linux/2.2.0-static/charlock_holmes-0.7.3/gem_make.out An error occurred while installing charlock_holmes (0.7.3), and Bundler cannot continue. Make sure that `gem install charlock_holmes -v '0.7.3'` succeeds before bundling. ! ! Failed to install gems via Bundler. ! ! Push rejected, failed to compile Ruby app. ! Push failed

エラーの部分だけ抜き取るとこのように表示されています。

###試したこと
brew install icu4cの実行を試みたがこちらもエラーとなります。
エラー内容

$ brew install icu4c Warning: icu4c is a keg-only and another version is linked to opt. Use `brew install --force` if you want to install this version

次にbrew install --forceと言われたのでbrew install icu4c --forceを実行しましたがエラー。
エラー内容

$ brew install --force Warning: icu4c-58.2 already installed, it's just not linked.

既にインストールされているがリンクされていないと言われたので、brew link icu4cを実行しました。

Warning: Already linked: /usr/local/Cellar/icu4c/58.2 To relink: brew unlink icu4c && brew link icu4c

既にリンクされていると言われてしまい手詰まりです。

色々調べてはみたものの解決できずにいます。
どのようにすれば解決できるかご教授頂けると嬉しいです。
よろしくお願いします。

###補足情報(言語/FW/ツール等のバージョンなど)
rails4.2.3

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

Heroku上でアプリをbuildしている部分でのエラーですので、brewでローカル環境を整えても恐らく問題は解決しません。

libicu-devをHeroku上で使うにはbuildpackを追加してあげる必要があります。自分で試した結果ではなく恐縮ですが、Web上を探すとcharlock_holmesをHerokuで使うためのbuildpackの設定方法がいくつか見つかりますので、それらを試してみては如何でしょうか?

  • heroku-buildpack-aptをインストールしてaptでlibicu-devをインストールする方法
  • heroku-icu-buildpackをインストールする方法

というのはあるようですね。

投稿2017/03/30 03:26

tbn.sh

総合スコア173

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

lapi

2017/03/30 03:48

ご回答ありがとうございます。 brewでローカル環境を整えれば大丈夫かと思っていたのですが、そもそもそこから間違っていたのですね。 tbn.shさんのご指摘通り、buildpackを追加して試してみます! ありがとうございました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問