When you get “You don’t have write permissions for the /usr/bin directory”
in your installation with gem, you can solve the issue with the option -n /usr/local/bin.
Many internet sources said so. Of cource it works.
I thought this is a good chance to look a little more about gem install options.
We can get the information by ‘gem help install’ in the terminal.
Several useful options
I found several useful options in the help document as follows.
install command options
-v, --version VERSION: Specify version of gem to install --[no-]prerelease: Allow prerelease versions of a gem to be installed. (Only for listed gems) -i, --install-dir: DIR Gem repository directory to get installed gems -n, --bindir DIR: Directory where executables are located
-h, --help: Get help on this command (same as gem help command) -V, --[no-]verbose: Set the verbose level of output -q, --quiet: Silence command progress meter --silent: Silence RubyGems output --config-file FILE: Use this config file instead of default (maybe useful for the batch-like jobs) --backtrace: Show stack backtrace on errors