Skip to content

Instantly share code, notes, and snippets.

@joaomarcos96
Last active February 8, 2021 13:10
Show Gist options
  • Save joaomarcos96/767171a91314e7c8c4583b34bdb86ad8 to your computer and use it in GitHub Desktop.
Save joaomarcos96/767171a91314e7c8c4583b34bdb86ad8 to your computer and use it in GitHub Desktop.
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