title: rmagick auto wrap text undefined method 'write'
body: <p>RMagick is supposed to auto wrap text on the image and add breaklines to that text. Here is my code for doing so: </p>
  
  <pre><code>def word_wrap(text, columns = 80)
  text.split("\n").collect do |line|
    line.length &gt; columns ? line.gsub(/(.{1, #{columns}})(\s+|$)/, "\\1\n").strip : line
  end * "\n"
  end
  
  process :caption
  
  def caption
    manipulate! do |source|
  
      txt = Magick::Draw.new
      txt.font_family = "Impact"
      txt.fill = "#ffffff"
  
  
      position = 80
      top_caption = model.top_caption
      word_wrap(top_caption, 90).split("\n").each do |row|
        source.annotate(txt, 0, 0, 0, position +=20, row)
      end
    end
  end
  end
  </code></pre>
  
  <p>and I get this error: </p>
  
  <p>(with asasfasf being the text I have written in the text - the top_caption)</p>
  
  <pre><code> NoMethodError in AnswersController#create
  
   undefined method `write' for ["asasfasf"]:Array
  
   app/uploaders/answer_uploader.rb:53:in `caption'
   app/controllers/answers_controller.rb:11:in `create'
  </code></pre>
  
  <p>create action: </p>
  
  <pre><code>def create
      @answer = Answer.new(params[:answer])
      @answer.user_id = current_user.id
      @answer.picture_id = daily_picture.id
      @answer.answer = daily_picture.image
      if @answer.save
        redirect_to root_path
      end
    end
  </code></pre>
  
  <p>and the error in the console:</p>
  
  <pre><code>Completed 500 Internal Server Error in 69ms
  
  NoMethodError (undefined method `annotate' for #&lt;Picture:0x007ffd2f578c88&gt;):
    app/uploaders/answer_uploader.rb:64:in `block (2 levels) in caption'
    app/uploaders/answer_uploader.rb:63:in `each'
    app/uploaders/answer_uploader.rb:63:in `block in caption'
    app/uploaders/answer_uploader.rb:53:in `caption'
    app/controllers/answers_controller.rb:11:in `create'
  </code></pre>
  
  <p>Where is the problem in the code?</p>
  
  <p>Thanks!</p>