Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Autolinking a Tweet object from twitter gem v5.2.0 raises an error #101

trliner opened this Issue · 4 comments

3 participants


The auto_link method raises a RuntimeError when passed the text of a Twitter::Tweet object from the latest version (5.2.0) of the twitter gem.

Here's an example:

require 'twitter' # 5.2.0
require 'twitter-text' # 1.7.0

client = do |config|
  config.consumer_key        = "YOUR_CONSUMER_KEY"
  config.consumer_secret     = "YOUR_CONSUMER_SECRET"
  config.access_token        = "YOUR_ACCESS_TOKEN"
  config.access_token_secret = "YOUR_ACCESS_SECRET"

tweet = client.user_timeline('gem').first

# => RuntimeError: can't modify frozen String

This was working as expected in version 4.8.1, but I haven't tested any of the versions in between.


Nice catch. Sounds like a quickfix would be tweet.text.dup to unfreeze it first. Pull requests are appreciated, probably add dup as the first action of the method (and maybe other places). Otherwise I'll fix it as I go through my tasks.


I think that ought to do the trick.


can this be closed now?


Yep, fixed I believe.

@jakl jakl closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.