Ignoring GEM because its extensions are not built

On both my work and home computers, I recently upgraded Ruby to 2.3.1, using ruby-install. I use chruby as my Ruby switcher. I started seeing this warning in my terminal: Ignoring bcrypt-3.1.11 because its extensions are not built. Try: gem pristine bcrypt –version 3.1.11 Ignoring bcrypt-3.1.10 because its extensions are not built. Try: gem pristine … Read more

What is the canonical way to trim a string in Ruby without creating a new string?

This is what I have now – which looks too verbose for the work it is doing. @title = tokens[Title].strip! || tokens[Title] if !tokens[Title].nil? Assume tokens is a array obtained by splitting a CSV line. now the functions like strip! chomp! et. all return nil if the string was not modified “abc”.strip! # => nil … Read more