Note that there are some explanatory texts on larger screens.

plurals
  1. POInfinite recursion with Paperclip remote image uploading
    primarykey
    data
    text
    <p>After successfully implementing the code from Trevor Turk's blogpost <a href="http://trevorturk.com/2008/12/11/easy-upload-via-url-with-paperclip/" rel="nofollow">"Easy Upload via URL with Paperclip"</a> several times already, in this latest iteration my app gives me the following error:</p> <pre><code>Started POST "/pins" for 127.0.0.1 at 2013-02-22 14:05:20 -0300 Processing by PinsController#create as HTML Parameters: {"utf8"=&gt;"✓", "authenticity_token"=&gt;"Q6kmHS7Co+j2Y4JYd+3YO0OmDHU/upK1ADvRbS8UAIc=", "pin"=&gt;{"image_url"=&gt;"http://media-cache-ec3.pinterest.com/550x/b4/b7/82/b4b782bf268cb52d201853886510e3a9.jpg", "description"=&gt;"Test"}, "commit"=&gt;"Create Pin"} [1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1[0m [1m[35m (0.1ms)[0m begin transaction Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-c7vstl' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-17pzds5' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1kh7v9y' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-ngtq1u' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-jzmkac' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1x4vpj5' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1iwdp4q' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-cvro9z' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1tn727x' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-q77ipe' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1e5wt1x' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-7xaoic' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-kzw7ab' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-m1frw1' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-aojdb8' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-kzn0w6' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-cj55fi' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-d3s1h0' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-15hmo2q' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-17apjuj' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-f97eej' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1t9ou1f' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1dfnz21' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-ozc0ac' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1uiz51r' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-57ahli' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-u96rmb' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-vt2ph3' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-st55ih' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1phbyb3' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-wdu3nu' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1iit16u' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-117n6l2' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-qr5380' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-tod0l9' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1u19f33' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1rta45x' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-6o0hug' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-14e2zh7' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1lnwdhm' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-9en3jt' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-hhb0b2' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-9b0ak8' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1yyvnl9' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-15ebo0r' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-kpavxm' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-qgrtq2' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1erqxe5' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1h23wb0' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1heb0b3' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1oswpj8' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1y1z7di' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-89spzg' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-96op3f' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-4aizhy' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1s5nw68' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-k4jb2y' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1gjqddi' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1nzej79' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1yurmzq' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1yvoyxn' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-ec4b0b' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-12zau9q' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-va8ryp' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-11362zg' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-14d0lek' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-65t94r' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-2zqkrs' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-nzvtnc' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-mokk7l' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1v6n3k3' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-7tvcwq' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-z4qieu' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-5let78' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1azr7s1' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-xfbbhj' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-qpuxih' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1oqv313' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1lw2iyw' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-sgsyl7' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-z3kc9d' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1csf869' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1615j19' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-gjlms9' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1t0vhjc' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1x2w35' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1wgmxox' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-ce9qo7' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1mxr8v0' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1y1716x' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-19vj2ky' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1s2yq7p' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-10xd3y3' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-fohqek' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1p8i5y4' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-mx211u' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-nhtv6r' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1sdvwt9' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1nu8xde' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1yo03yt' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-pfu1cg' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-oqslme' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1s8wcup' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1x91fzc' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1b3zxzf' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1miary7' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-18ef2u' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-eo8odm' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1noqove' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-hl4yhz' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-mqjd16' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-10do8b2' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-n1dqn2' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1raiaq5' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1myor64' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1i2e0b3' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-hgtnym' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-lzuyqt' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-1cvazmm' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-shgn3h' Command :: file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-a1n19w' [1m[36m (0.1ms)[0m [1mrollback transaction[0m Completed 500 Internal Server Error in 201007ms Errno::EMFILE (Too many open files - file -b --mime '/var/folders/8z/sh44jtbs33163s5hsjxj6tsc0000gr/T/open-uri20130222-25293-a1n19w'): app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/models/pin.rb:27:in `download_remote_image' app/controllers/pins_controller.rb:48:in `block in create' app/controllers/pins_controller.rb:47:in `create' </code></pre> <p>Looks like there's some sort of infinite recursion happening, though I can't figure out where.</p> <p>Here's what the relevant model looks like:</p> <pre><code>require 'open-uri' class Pin &lt; ActiveRecord::Base belongs_to :user attr_accessible :description, :image, :image_url has_attached_file :image, styles: { medium: "320x240&gt;"} validates :description, presence: true validates :user_id, presence: true validates_attachment :image, presence: true, content_type: { content_type: ['image/jpeg', 'image/jpg', 'image/png', 'image/gif'] }, size: { less_than: 5.megabytes } # Remote image downloading attr_accessor :image_url before_validation :download_remote_image, :if =&gt; :image_url_provided? private def image_url_provided? !self.image_url.blank? end def download_remote_image self.image = URI.parse(image_url) # self.image_remote_url = image_url end def do_download_remote_image io = open(URI.parse(image_url)) def io.original_filename; base_uri.path.split('/').last; end io.original_filename.blank? ? nil : io rescue # catch url errors with validations instead of exceptions (Errno::ENOENT, OpenURI::HTTPError, etc...) print "An error occurred: ",$!, "\n" end end </code></pre> <p>And my pins/_form.html.erb</p> <pre><code>&lt;%= simple_form_for(@pin, html: { class: "form-horizontal"}) do |f| %&gt; &lt;%= f.error_notification %&gt; &lt;%= f.full_error :image_file_size, class: "alert alert-error" %&gt; &lt;%= f.full_error :image_content_type, class: "alert alert-error" %&gt; &lt;%= f.input :image, label: "Upload an image" %&gt; &lt;%= f.input :image_url, label: false, placeholder: "http://" %&gt; &lt;%= f.input :description, as: :text, input_html: { rows: "3" } %&gt; &lt;div class="form-actions"&gt; &lt;%= f.button :submit, class: "btn btn-primary" %&gt; &lt;/div&gt; &lt;% end %&gt; </code></pre> <p>Finally, my Pins controller is pretty standard:</p> <pre><code> def new @pin = current_user.pins.build respond_to do |format| format.html # new.html.erb format.json { render json: @pin } end end def create @pin = current_user.pins.build(params[:pin]) respond_to do |format| if @pin.save format.html { redirect_to @pin, notice: 'Pin was successfully created.' } format.json { render json: @pin, status: :created, location: @pin } else format.html { render action: "new" } format.json { render json: @pin.errors, status: :unprocessable_entity } end end end </code></pre> <p>It seems like it's running download_remote_image over and over again.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload