title: Why do I get "undefined method `encoding' "?
body: <p>Why do I get "undefined method `encoding' "?
  How can I fix this?</p>
  
  <p><strong>Error Message</strong></p>
  
  <pre><code>NoMethodError (undefined method `encoding' for #&lt;Array:0x000000218f61e8&gt;):
   app/controllers/messages_controller.rb:255:in `deliver'
  </code></pre>
  
  <p><strong>messages_controller.rb</strong></p>
  
  <pre><code># coding: UTF-8
  
  class MessagesController &lt; ApplicationController
  
      deliver
          users = User.confirmed.order("created_at ASC")
  
          @users_emails = []          
          users.each do |user|
              @users_emails += [user.email]
          end
  
          subject = params[:messages][:subject] 
          body = params[:messages][:body]
  
          CallMailer.call_email(@users_emails, subject, body).deliver  &lt;= This is line 255  
      end
  
  end
  </code></pre>
  
  <p><strong>mailers/call_mailer.rb</strong></p>
  
  <pre><code># coding: UTF-8
  
  class CallMailer &lt; ActionMailer::Base
  
      default :from =&gt; "dont-reply@example.com"
  
      def call_email(users_emails, mesesage_subject, mesesage_body)
          @users_emails = users_emails
          @mesesage_subject = mesesage_subject
          @mesesage_body = mesesage_body
          mail(
              :bcc =&gt; @users_emails,
              :subject =&gt; @mesesage_subject,
              :body =&gt; @mesesage_body) do |format|
              format.html
          end
      end
  
  end
  </code></pre>