title: How to resize images in Ruby (Rails) without using RMagick?
body: <p>I need to load images from URL (stored in Amazon S3 bucket), create a thumbnail from this image and upload it (the new thumbnail) to the same S3 bucket.</p>
  
  <p>Last 5 hours I am trying to install RMagick on my Lion OSX, but all my threads getting grey from RMagic. It seems to be impossible to install RMagick on OSX.</p>
  
  <p>Thus, is there any other way to do it?</p>
  
  <p><strong>EDIT:</strong> 
  In <code>Gemfile</code>:
  gem "rmagick"</p>
  
  <p>Error:</p>
  
  <pre><code>uninitialized constant ImagesController::Magick
  </code></pre>
  
  <p>In controller:</p>
  
  <pre><code>  def resize_images
      require 'rubygems'
      require 'RMagick'
      include Magick
      require "open-uri"
  
      file_url = open('URL to image')
      save_path = "/"
  
      f = File.new( File.join(save_path, file_url), "wb")
      f.write file_url.read 
      f.close
  
      image = Magick::Image.read(file_url).first
      image.change_geometry!("1500x150") { |cols, rows, img|
          newimg = img.resize(cols, rows)
          newimg.write("newfilename.jpg")
      }
    end
  </code></pre>
  
  <p><strong>EDIT2:</strong></p>
  
  <p>When I put this into <code>Gemfile</code>:</p>
  
  <pre><code>gem "rmagick", :require =&gt; 'RMagick'
  </code></pre>
  
  <p>bundle it and run the server, I get following error:</p>
  
  <pre><code>/Users/adam/.rvm/gems/ruby-1.9.3-p385@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:197: warning: Insecure world writable dir /usr/local/mysql in PATH, mode 040777
  /Users/adam/.rvm/gems/ruby-1.9.3-p385@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:197: warning: Insecure world writable dir /usr/local/mysql in PATH, mode 040777
  /Users/adam/.rvm/gems/ruby-1.9.3-p385@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `require': cannot load such file -- RMagick (LoadError)
      from /Users/adam/.rvm/gems/ruby-1.9.3-p385@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
      from /Users/adam/.rvm/gems/ruby-1.9.3-p385@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `each'
      from /Users/adam/.rvm/gems/ruby-1.9.3-p385@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `block in require'
      from /Users/adam/.rvm/gems/ruby-1.9.3-p385@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `each'
      from /Users/adam/.rvm/gems/ruby-1.9.3-p385@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `require'
      from /Users/adam/.rvm/gems/ruby-1.9.3-p385@global/gems/bundler-1.2.3/lib/bundler.rb:128:in `require'
      from /Users/adam/rubydev/looky/config/application.rb:9:in `&lt;top (required)&gt;'
      from /Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.9/lib/rails/commands.rb:53:in `require'
      from /Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.9/lib/rails/commands.rb:53:in `block in &lt;top (required)&gt;'
      from /Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.9/lib/rails/commands.rb:50:in `tap'
      from /Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/railties-3.2.9/lib/rails/commands.rb:50:in `&lt;top (required)&gt;'
      from script/rails:6:in `require'
      from script/rails:6:in `&lt;main&gt;'
  </code></pre>