Installing Ruby gems not working with Homebrew

Homebrew is nice. However unlike brew and npm, gem does not make aliases in /usr/local/bin automatically. Solution I went for a very simple approach (as of March 2020): # Based on “`brew –prefix ruby`/bin” export PATH=/usr/local/opt/ruby/bin:$PATH # Based on “`gem environment gemdir`/bin” export PATH=/usr/local/lib/ruby/gems/3.0.0/bin:$PATH Add this to your .bashrc (or .bash_profile, .zshrc, etc.). That’s it! … Read more

How should I provide YARD/RDoc documentation for Ruby keyword arguments?

Should I just continue to use the @param keyword? Yes. YARD recognizes keyword arguments. Use @param to document a single method parameter (either regular or keyword) with a given name, type and optional description: # @param query [String] The search string # @param exact_match [Boolean] whether to do an exact match # @param results_per_page [Integer] … Read more

Ruby: Too many open files @ rb_sysopen

EMFILE is too many files opened in your process. ENFILE is too many files opened in the entire system. So Errno::EMFILE is due to the ruby process opening too many files. This limit is probably set to the default 1024 can be seen with: $ulimit -n 1024 Instead of: $ulimit unlimited You can raise the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)