Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 623389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:05:16+00:00 2026-05-13T19:05:16+00:00

I would think this is a Ruby difference, but I’m using the same Ruby

  • 0

I would think this is a Ruby difference, but I’m using the same Ruby version 1.8.7. This is related to this post (to answer “why do you need this?”). This code works in 2.2.2

Loading development environment (Rails 2.2.2)
>> module ActionMailer
>> Utils.normalize_new_lines("blah")
>> end

but in 2.3.5 it fails

Loading development environment (Rails 2.3.5)
>> module ActionMailer
>> Utils.normalize_new_lines("blah")
>> end
NoMethodError: undefined method `normalize_new_lines' for ActionMailer::Utils:Module
from (irb):2

What’s new about 2.3.5 that this would fail? The method is there in 2.3.5, so this works

Loading development environment (Rails 2.3.5)
>> include ActionMailer
>> include Utils
>> normalize_new_lines("blah")

I realize this is probably an important Rails difference.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T19:05:16+00:00Added an answer on May 13, 2026 at 7:05 pm

    Looks like the code changed from version 2.2 to version 2.3.5

    old:

    module ActionMailer
      module Utils #:nodoc:
        def normalize_new_lines(text)
          text.to_s.gsub(/\r\n?/, "\n")
        end
        module_function :normalize_new_lines
      end
    end
    

    new:

    module ActionMailer
      module Utils #:nodoc:
        def normalize_new_lines(text)
          text.to_s.gsub(/\r\n?/, "\n")
        end
      end
    end
    

    I guess you could restore the old behavior by calling module_function yourself:

    $ script/console
    Loading development environment (Rails 2.3.5)
    >> module ActionMailer
    >> module Utils
    >> module_function :normalize_new_lines
    >> end
    >> Utils.normalize_new_lines("blah")
    >> end
    => "blah"
    >> 
    

    EDIT: Or better yet just include the module (per Simone)

    >> include ActionMailer::Utils

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 506k
  • Answers 506k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think this gets you what you want: $i =… May 16, 2026 at 3:44 pm
  • Editorial Team
    Editorial Team added an answer the control statement is: for (int i = 0; i… May 16, 2026 at 3:44 pm
  • Editorial Team
    Editorial Team added an answer It turns out that writing your own custom object that… May 16, 2026 at 3:44 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

How could I implement this? I think my solution is very dirty, and I
Ok, so I was comparing some stuff in my own DSL to Ruby. One
I have a working solution in java using a classic state design pattern and
I need to create some way to get a local WAR file deployed on
In fairly large Ruby application, we have a situation where a given object is
This snippet throws an exception: x = nil jsoned = x.to_json puts 'x.to_json=' +
I'm still new to Ruby on Rails and I'm currently having a issue with
I am getting this error in maybe one out of 50-100 requests. I am
So Candy is a really simple library for interacting with Mongo in Ruby. My
I've been using gimite / web-socket-js to implement a WebSocket past simply Chrome and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.