Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix condition for String#encode! #171

Closed
wants to merge 1 commit into from

Conversation

chulkilee
Copy link

No description provided.

@macournoyer
Copy link
Owner

This doesn't seem to be required. What error do you get and what Ruby version?

@chulkilee
Copy link
Author

It is required because the existence of encode! does not necessary mean the existence of Encoding class.

Maybe it would be better to check ruby version >= 1.9, but I do not know much about different ruby implementation, so made the minimum change (which is enough).

It is happening when I use Rails 3 action mailer with ruby 1.8.7 - I added String#encode! which does nothing. In this case, Thin raises errors (unknown class Encoding). See ActionMailer 3 error - undefined method `encode!' for “Welcome”:String for the reference.

@macournoyer
Copy link
Owner

Hmm. Might as well just check w/ if defined?(Encoding). Drop the respond_to.

macournoyer added a commit that referenced this pull request Sep 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants