LoginSignup
7
7

More than 5 years have passed since last update.

Sublime Text 3, Rubocop で "Invalid byte sequence in us-ascii"

Last updated at Posted at 2014-04-23

Sublime Text 3 の Rubocop プラグインでマルチバイトなコードを読ませると下記のようなエラーが出る問題。

Inspecting 1 file
F

Offenses:

special.rake:1:1: F: Invalid byte sequence in us-ascii.

1 file inspected, 1 offense detected
[Finished in 0.5s with exit code 1]
[cmd: ['/Users/mukoyama/.rbenv/bin/rbenv exec rubocop  /Users/mukoyama/Documents/workspace/project/lib/tasks/special.rake']]
[dir: /Users/mukoyama/Documents/workspace/project/lib/tasks]
[path: /usr/bin:/bin:/usr/sbin:/sbin]

検索してもヒットしなかったので、一応書き残す。
単純に環境変数 LANG を読み込まないためという問題の様なので

{
  "rubocop_command": "LANG=ja_JP.UTF-8 /Users/mukoyama/.rbenv/bin/rbenv exec rubocop"
}

上記の様な設定を RuboCop.sublime-settings に書いて上げれば動く。
でも、コレが答えじゃない気がする・・・。

そもそも path の値がシステムデフォルトのみっぽい。

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