LoginSignup
2
2

More than 5 years have passed since last update.

Docker for Mac OSX × Jekyllでエンコーディングエラー

Posted at

Docker for Mac OSXを使ってJekyllをいじっているのですが。ファイルを編集すると次のようなエラーが…

server    |       Regenerating: 1 file(s) changed at 2016-09-26 14:48:17 E, [2016-09-26T14:48:21.007586 #6] ERROR -- : run() in thread failed: invalid byte sequence in US-ASCII:\n /usr/local/lib/ruby/2.3.0/pathname.rb:41:in `=~'
server    | /usr/local/lib/ruby/2.3.0/pathname.rb:41:in `chop_basename'
server    | /usr/local/lib/ruby/2.3.0/pathname.rb:358:in `plus'
server    | /usr/local/lib/ruby/2.3.0/pathname.rb:350:in `+'
server    | /usr/local/bundle/gems/listen-3.0.8/lib/listen/adapter/linux.rb:47:in `_process_event'
server    | /usr/local/bundle/gems/listen-3.0.8/lib/listen/adapter/base.rb:42:in `block (2 levels) in configure'
server    | /usr/local/bundle/gems/rb-inotify-0.9.7/lib/rb-inotify/notifier.rb:205:in `block in watch'
server    | /usr/local/bundle/gems/rb-inotify-0.9.7/lib/rb-inotify/watcher.rb:41:in `callback!'
server    | /usr/local/bundle/gems/rb-inotify-0.9.7/lib/rb-inotify/event.rb:128:in `callback!'
server    | /usr/local/bundle/gems/rb-inotify-0.9.7/lib/rb-inotify/notifier.rb:238:in `block in process'
server    | /usr/local/bundle/gems/rb-inotify-0.9.7/lib/rb-inotify/notifier.rb:238:in `each'
server    | /usr/local/bundle/gems/rb-inotify-0.9.7/lib/rb-inotify/notifier.rb:238:in `process'
server    | /usr/local/bundle/gems/rb-inotify-0.9.7/lib/rb-inotify/notifier.rb:221:in `run'
server    | /usr/local/bundle/gems/listen-3.0.8/lib/listen/adapter/linux.rb:39:in `_run'

生成されるファイル名が日本語だとエラーになります。

色々調べた結果、RubyがUS-ASCIIになっているのが原因でした(via dockerでpuppet実行エラー (invalid byte sequence in US-ASCII) - Qiita)。

docker-compose.yaml に下記を追加して解決。

environment:
  RUBYOPT: "-EUTF-8"
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2