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

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

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

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

0回答

507閲覧

cannot load such file -- charlock_holmes (LoadError)

shirou

総合スコア15

Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2018/09/09 09:38

前提・実現したいこと

Railsで新しく作成するアプリに Markdownを導入したく
こちらのサイトを参考に

Gemfile

gem 'qiita-markdown'
gem 'github-linguist'
bundle
bundleが失敗する人は2つのプラグインが足りていません
以下を実行してください。
ちなみにCloud9ではエラーは出ません。
$ sudo yum -y install libicu-devel
$ gem install charlock_holmes -v '0.7.3'
$ sudo yum -y install cmake
$ gem install rugged -v '0.25.0b4'

インストールを済ませたのちにrails sを実行すると表題のエラーに遭遇。
検索をかけて出た解決法は一通り試しましたが一向に解決出来ません。。

発生している問題・エラーメッセージ

bundleが失敗したため、 libicu-develcmakeをそれぞれインストールした後に rails sを実行すると

terminal

1Traceback (most recent call last): 2 81: from bin/rails:3:in `<main>' 3 80: from bin/rails:3:in `load' 4 79: from /Users/Natsuki/rails_workplace/Profile/bin/spring:15:in `<top (required)>' 5 中略 6/Users/Natsuki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' 7: cannot load such file -- charlock_holmes (LoadError) 8

該当のソースコード

gemfile

1source 'https://rubygems.org' 2git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 4ruby '2.5.1' 5 6# Add Markdown on rails 7gem 'qiita-markdown' 8gem 'github-linguist' 9# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 10gem 'rails', '~> 5.2.1' 11# Use postgresql as the database for Active Record 12gem 'pg', '>= 0.18', '< 2.0' 13# Use Puma as the app server 14gem 'puma', '~> 3.11' 15# Use SCSS for stylesheets 16gem 'sass-rails', '~> 5.0' 17# Use Uglifier as compressor for JavaScript assets 18gem 'uglifier', '>= 1.3.0' 19# See https://github.com/rails/execjs#readme for more supported runtimes 20# gem 'mini_racer', platforms: :ruby 21# reflect bootstrap 22gem 'bootstrap-sass' 23# Use CoffeeScript for .coffee assets and views 24gem 'coffee-rails', '~> 4.2' 25# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 26gem 'turbolinks', '~> 5' 27# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 28gem 'jbuilder', '~> 2.5' 29# Use Redis adapter to run Action Cable in production 30# gem 'redis', '~> 4.0' 31# Use ActiveModel has_secure_password 32# gem 'bcrypt', '~> 3.1.7'

Gemfile.lock

1GEM 2 remote: https://rubygems.org/ 3 specs: 4 actioncable (5.2.1) 5 actionpack (= 5.2.1) 6 nio4r (~> 2.0) 7 websocket-driver (>= 0.6.1) 8 actionmailer (5.2.1) 9 actionpack (= 5.2.1) 10 actionview (= 5.2.1) 11 activejob (= 5.2.1) 12 mail (~> 2.5, >= 2.5.4) 13 rails-dom-testing (~> 2.0) 14 actionpack (5.2.1) 15 actionview (= 5.2.1) 16 activesupport (= 5.2.1) 17 rack (~> 2.0) 18 rack-test (>= 0.6.3) 19 rails-dom-testing (~> 2.0) 20 rails-html-sanitizer (~> 1.0, >= 1.0.2) 21 actionview (5.2.1) 22 activesupport (= 5.2.1) 23 builder (~> 3.1) 24 erubi (~> 1.4) 25 rails-dom-testing (~> 2.0) 26 rails-html-sanitizer (~> 1.0, >= 1.0.3) 27 activejob (5.2.1) 28 activesupport (= 5.2.1) 29 globalid (>= 0.3.6) 30 activemodel (5.2.1) 31 activesupport (= 5.2.1) 32 activerecord (5.2.1) 33 activemodel (= 5.2.1) 34 activesupport (= 5.2.1) 35 arel (>= 9.0) 36 activestorage (5.2.1) 37 actionpack (= 5.2.1) 38 activerecord (= 5.2.1) 39 marcel (~> 0.3.1) 40 activesupport (5.2.1) 41 concurrent-ruby (~> 1.0, >= 1.0.2) 42 i18n (>= 0.7, < 2) 43 minitest (~> 5.1) 44 tzinfo (~> 1.1) 45 addressable (2.5.2) 46 public_suffix (>= 2.0.2, < 4.0) 47 archive-zip (0.11.0) 48 io-like (~> 0.3.0) 49 arel (9.0.0) 50 autoprefixer-rails (9.1.4) 51 execjs 52 bindex (0.5.0) 53 bootsnap (1.3.1) 54 msgpack (~> 1.0) 55 bootstrap-sass (3.3.7) 56 autoprefixer-rails (>= 5.2.1) 57 sass (>= 3.3.4) 58 builder (3.2.3) 59 byebug (10.0.2) 60 capybara (3.7.1) 61 addressable 62 mini_mime (>= 0.1.3) 63 nokogiri (~> 1.8) 64 rack (>= 1.6.0) 65 rack-test (>= 0.6.3) 66 xpath (~> 3.1) 67 charlock_holmes (0.7.6) 68 childprocess (0.9.0) 69 ffi (~> 1.0, >= 1.0.11) 70 chromedriver-helper (1.2.0) 71 archive-zip (~> 0.10) 72 nokogiri (~> 1.8) 73 coffee-rails (4.2.2) 74 coffee-script (>= 2.2.0) 75 railties (>= 4.0.0) 76 coffee-script (2.4.1) 77 coffee-script-source 78 execjs 79 coffee-script-source (1.12.2) 80 concurrent-ruby (1.0.5) 81 crass (1.0.4) 82 erubi (1.7.1) 83 escape_utils (1.2.1) 84 execjs (2.7.0) 85 ffi (1.9.25) 86 gemoji (3.0.0) 87 github-linguist (6.4.1) 88 charlock_holmes (~> 0.7.6) 89 escape_utils (~> 1.2.0) 90 mime-types (>= 1.19) 91 rugged (>= 0.25.1) 92 globalid (0.4.1) 93 activesupport (>= 4.2.0) 94 greenmat (3.2.2.4) 95 html-pipeline (2.8.4) 96 activesupport (>= 2) 97 nokogiri (>= 1.4) 98 i18n (1.1.0) 99 concurrent-ruby (~> 1.0) 100 io-like (0.3.0) 101 jbuilder (2.7.0) 102 activesupport (>= 4.2.0) 103 multi_json (>= 1.2) 104 listen (3.1.5) 105 rb-fsevent (~> 0.9, >= 0.9.4) 106 rb-inotify (~> 0.9, >= 0.9.7) 107 ruby_dep (~> 1.2) 108 loofah (2.2.2) 109 crass (~> 1.0.2) 110 nokogiri (>= 1.5.9) 111 mail (2.7.0) 112 mini_mime (>= 0.1.1) 113 marcel (0.3.2) 114 mimemagic (~> 0.3.2) 115 mem (0.1.5) 116 method_source (0.9.0) 117 mime-types (3.2.2) 118 mime-types-data (~> 3.2015) 119 mime-types-data (3.2018.0812) 120 mimemagic (0.3.2) 121 mini_mime (1.0.1) 122 mini_portile2 (2.3.0) 123 minitest (5.11.3) 124 msgpack (1.2.4) 125 multi_json (1.13.1) 126 nio4r (2.3.1) 127 nokogiri (1.8.4) 128 mini_portile2 (~> 2.3.0) 129 nokogumbo (1.5.0) 130 nokogiri 131 pg (1.1.3) 132 public_suffix (3.0.3) 133 puma (3.12.0) 134 pygments.rb (1.2.1) 135 multi_json (>= 1.0.0) 136 qiita-markdown (0.10.0) 137 activesupport 138 gemoji 139 github-linguist 140 greenmat (>= 3.2.0.2, < 4) 141 html-pipeline (~> 2.0) 142 mem 143 pygments.rb 144 rugged (>= 0.21.1b2) 145 sanitize 146 rack (2.0.5) 147 rack-test (1.1.0) 148 rack (>= 1.0, < 3) 149 rails (5.2.1) 150 actioncable (= 5.2.1) 151 actionmailer (= 5.2.1) 152 actionpack (= 5.2.1) 153 actionview (= 5.2.1) 154 activejob (= 5.2.1) 155 activemodel (= 5.2.1) 156 activerecord (= 5.2.1) 157 activestorage (= 5.2.1) 158 activesupport (= 5.2.1) 159 bundler (>= 1.3.0) 160 railties (= 5.2.1) 161 sprockets-rails (>= 2.0.0) 162 rails-dom-testing (2.0.3) 163 activesupport (>= 4.2.0) 164 nokogiri (>= 1.6) 165 rails-html-sanitizer (1.0.4) 166 loofah (~> 2.2, >= 2.2.2) 167 railties (5.2.1) 168 actionpack (= 5.2.1) 169 activesupport (= 5.2.1) 170 method_source 171 rake (>= 0.8.7) 172 thor (>= 0.19.0, < 2.0) 173 rake (12.3.1) 174 rb-fsevent (0.10.3) 175 rb-inotify (0.9.10) 176 ffi (>= 0.5.0, < 2) 177 ruby_dep (1.5.0) 178 rubyzip (1.2.2) 179 rugged (0.27.4) 180 sanitize (4.6.6) 181 crass (~> 1.0.2) 182 nokogiri (>= 1.4.4) 183 nokogumbo (~> 1.4) 184 sass (3.5.7) 185 sass-listen (~> 4.0.0) 186 sass-listen (4.0.0) 187 rb-fsevent (~> 0.9, >= 0.9.4) 188 rb-inotify (~> 0.9, >= 0.9.7) 189 sass-rails (5.0.7) 190 railties (>= 4.0.0, < 6) 191 sass (~> 3.1) 192 sprockets (>= 2.8, < 4.0) 193 sprockets-rails (>= 2.0, < 4.0) 194 tilt (>= 1.1, < 3) 195 selenium-webdriver (3.14.0) 196 childprocess (~> 0.5) 197 rubyzip (~> 1.2) 198 spring (2.0.2) 199 activesupport (>= 4.2) 200 spring-watcher-listen (2.0.1) 201 listen (>= 2.7, < 4.0) 202 spring (>= 1.2, < 3.0) 203 sprockets (3.7.2) 204 concurrent-ruby (~> 1.0) 205 rack (> 1, < 3) 206 sprockets-rails (3.2.1) 207 actionpack (>= 4.0) 208 activesupport (>= 4.0) 209 sprockets (>= 3.0.0) 210 thor (0.20.0) 211 thread_safe (0.3.6) 212 tilt (2.0.8) 213 turbolinks (5.2.0) 214 turbolinks-source (~> 5.2) 215 turbolinks-source (5.2.0) 216 tzinfo (1.2.5) 217 thread_safe (~> 0.1) 218 uglifier (4.1.18) 219 execjs (>= 0.3.0, < 3) 220 web-console (3.7.0) 221 actionview (>= 5.0) 222 activemodel (>= 5.0) 223 bindex (>= 0.4.0) 224 railties (>= 5.0) 225 websocket-driver (0.7.0) 226 websocket-extensions (>= 0.1.0) 227 websocket-extensions (0.1.3) 228 xpath (3.1.0) 229 nokogiri (~> 1.8) 230 231PLATFORMS 232 ruby 233 234DEPENDENCIES 235 bootsnap (>= 1.1.0) 236 bootstrap-sass 237 byebug 238 capybara (>= 2.15) 239 chromedriver-helper 240 coffee-rails (~> 4.2) 241 github-linguist 242 jbuilder (~> 2.5) 243 listen (>= 3.0.5, < 3.2) 244 pg (>= 0.18, < 2.0) 245 puma (~> 3.11) 246 qiita-markdown 247 rails (~> 5.2.1) 248 sass-rails (~> 5.0) 249 selenium-webdriver 250 spring 251 spring-watcher-listen (~> 2.0.0) 252 turbolinks (~> 5) 253 tzinfo-data 254 uglifier (>= 1.3.0) 255 web-console (>= 3.3.0) 256 257RUBY VERSION 258 ruby 2.5.1p57 259 260BUNDLED WITH 261 1.16.3

試したこと

Githubよりinstallの項目を参考に

To install ICU with Homebrew:

$ brew install icu4c
Configure Bundler to always use the correct arguments when installing:
$ bundle config build.charlock_holmes --with-icu-dir=/usr/local/opt/icu4c
Using Gem to install directly without Bundler:
$ gem install charlock_holmes -- --with-icu-dir=/usr/local/opt/icu4c

上記の3つのコマンドを実施し、またGemfileに直接記述していたgem 'sharlock_holmesを削除
StackOverFlowなどで類似したエラーに対する回答は、やはりGithub上の公式のインストール手順に沿ったものであった為、他に打つ手がなくなり困惑です。。

gem uninstall sharlock_holmesを実行した後に bundle installを試して実行しましたが同じエラーに遭遇します。
どうやらGemfileに直接記述しなくともgemがインストールされる設定が含まれていたようで、該当アプリ以外においても影響が出るのではないかと不安です。

補足情報(FW/ツールのバージョンなど)

Rails 5.2.0
Mac OS X

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

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

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

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

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

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問