I am trying to run the ruby script found here
but I am getting the error
invalid multibyte char (US-ASCII)
http = Net::HTTP.new("twitter.com", Net::HTTP.https_default_port())
When you run the script with Ruby 1.9, change the first two lines of the script to:
#!/usr/bin/env ruby # encoding: utf-8 require 'net/http'
This tells Ruby to run the script with support for the
UTF-8 character set. Without that line Ruby 1.9 would default to the
US_ASCII character set.
Just for the record: This will not work in Ruby 1.8, because 1.8 doesn't knew anything about string encodings. And the line is not needed anymore in Ruby 2.0, because Ruby 2.0 is using
UTF-8 as the default anyway.