- Install
rubocop-daemon
gem (https://github.com/fohte/rubocop-daemon#installation):
gem 'rubocop-daemon', require: false
- 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
- Append to
~/.bashrc
:
export PATH="/usr/local/bin/rubocop-daemon-wrapper:$PATH"
export RUBOCOP_DAEMON_USE_BUNDLER=true
- 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
- Remove any netcat tool (https://wiki.archlinux.org/index.php/Network_tools#Netcat) and install OpenBSD netcat:
sudo pacman -Syu --needed openbsd-netcat