Rubocop: Can't install rubocop on alpine

Created on 18 Aug 2019  Â·  3Comments  Â·  Source: rubocop-hq/rubocop

Rubcop doesn't appear to run on Alpine.

When building the following docker file:

FROM python:3.8.0b3-alpine

RUN apk add alpine-sdk git ruby ruby-dev
RUN gem install --no-ri --no-rdoc rubocop

and running

docker run %container% rubocop

It throws the following error and rubocop is unusable

Traceback (most recent call last):
        9: from /usr/bin/rubocop:23:in `<main>'
        8: from /usr/bin/rubocop:23:in `load'
        7: from /usr/lib/ruby/gems/2.5.0/gems/rubocop-0.74.0/exe/rubocop:6:in `<top (required)>'
        6: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        5: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        4: from /usr/lib/ruby/gems/2.5.0/gems/rubocop-0.74.0/lib/rubocop.rb:575:in `<top (required)>'
        3: from /usr/lib/ruby/gems/2.5.0/gems/rubocop-0.74.0/lib/rubocop.rb:575:in `require_relative'
        2: from /usr/lib/ruby/gems/2.5.0/gems/rubocop-0.74.0/lib/rubocop/formatter/json_formatter.rb:3:in `<top (required)>'
        1: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'

Expected behavior

Would expect rubocop to install correctly

Actual behavior

rubocop runs properly

RuboCop version

$ [bundle exec] rubocop -V
throws the same error as above

Most helpful comment

Your Ruby installation is incomplete:

 FROM python:3.8.0b3-alpine

-RUN apk add alpine-sdk git ruby ruby-dev
+RUN apk add alpine-sdk git ruby-full ruby-dev
 RUN gem install --no-ri --no-rdoc rubocop

(or install ruby-json, ruby-etc, …)

Also see https://pkgs.alpinelinux.org/package/edge/main/x86/ruby-full

All 3 comments

Your Ruby installation is incomplete:

 FROM python:3.8.0b3-alpine

-RUN apk add alpine-sdk git ruby ruby-dev
+RUN apk add alpine-sdk git ruby-full ruby-dev
 RUN gem install --no-ri --no-rdoc rubocop

(or install ruby-json, ruby-etc, …)

Also see https://pkgs.alpinelinux.org/package/edge/main/x86/ruby-full

Thanks @buehmann!

If this doesn't solve it, feel free to reopen the issue.

Worked thank you

Was this page helpful?
0 / 5 - 0 ratings

Related issues

deivid-rodriguez picture deivid-rodriguez  Â·  3Comments

kirrmann picture kirrmann  Â·  3Comments

tedPen picture tedPen  Â·  3Comments

herwinw picture herwinw  Â·  3Comments

cabello picture cabello  Â·  3Comments