Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Faster RuboCop for VSCode in Arch Linux

Faster RuboCop for VSCode in Arch Linux

  1. Install rubocop-daemon gem (https://github.com/fohte/rubocop-daemon#installation):
gem 'rubocop-daemon', require: false
  1. Install rubocop-daemon-wrapper (https://github.com/fohte/rubocop-daemon#more-speed):
curl https://raw.githubusercontent.com/fohte/rubocop-daemon/master/bin/rubocop-daemon-wrapper -o /tmp/rubocop-daemon-wrapper
sudo mkdir -p /usr/local/bin/rubocop-daemon-wrapper
sudo mv /tmp/rubocop-daemon-wrapper /usr/local/bin/rubocop-daemon-wrapper/rubocop
sudo chmod +x /usr/local/bin/rubocop-daemon-wrapper/rubocop
  1. Append to ~/.bashrc:
export PATH="/usr/local/bin/rubocop-daemon-wrapper:$PATH"
export RUBOCOP_DAEMON_USE_BUNDLER=true
  1. Configure to use in VSCode:
# If you don't use asdf, just remove it or replace it with rbenv for example
$ asdf which rubocop
<HOME>/.asdf/installs/ruby/x.y.z/bin/rubocop

# Override rubocop with a symlink to rubocop-daemon-wrapper
$ ln -fs /usr/local/bin/rubocop-daemon-wrapper $HOME/.asdf/installs/ruby/x.y.z/bin/rubocop
  1. Remove any netcat tool (https://wiki.archlinux.org/index.php/Network_tools#Netcat) and install OpenBSD netcat:
sudo pacman -Syu --needed openbsd-netcat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment