LoginSignup
1
0

More than 5 years have passed since last update.

Rubocopのcompliant syntaxの解決方法

Last updated at Posted at 2015-05-21

背景

rubocopは、最新版のRubyで動作していないと警告がでる

warning: parser/current is loading parser/ruby21, which recognizes
warning: 2.1.6-compliant syntax, but you are running 2.1.5.

解決

アップデート

手元のruby-buildが古かったので、ruby-buildをアップグレードする

$ brew upgrade ruby-build

インストール

$ rbenv install 2.1.6

2.1.6用のbundlerをインストールする

$ gem install bundler

出力結果

Fetching: bundler-1.9.9.gem (100%)
Successfully installed bundler-1.9.9
Parsing documentation for bundler-1.9.9
Installing ri documentation for bundler-1.9.9
Done installing documentation for bundler after 4 seconds
1 gem installed

ローカルのRubyを2.1.6にする

$ rbenv local 2.1.6 
$ ruby -v  

出力結果

ruby 2.1.6p336 (2015-04-13 revision 50298) [x86_64-darwin13.0]

Rubyのバージョンを固定しておく

$ vi ./.ruby-version 
2.1.6

参考

rbenvでMacにRuby 2.2.1 インストール(オプション指定最新版

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