.png image not showing after cURL command



I am following Michael Hartl’s Ruby on Rails Tutorial.

On p.215 the web page shows the rails image, yet all I am getting is the default image for when an image can’t display
I have used the line:

<%= link_to image_tag("rails.png", alt: "Rails logo"),
'http://rubyonrails.org/' %>

within the home.html.erb page.

Then, in the sample_app (filling-in-layout) branch, I copy pasted the command:

curl -O http://rubyonrails.org/images/rails.png

and then:

mv rails.png app/assets/images/

When I load the page, it only shows that default image on all websites when the image can’t be loaded, with the Alt text “Rails logo” over it and a link to http://rubyonrails.org/.

Any suggestions on how to fix or info on why this might be happening?


The link you posted to rails.png is a 404. The curl probably downloaded the 404 page for you as rails.png and causing you problems, namely an <img> tag trying to show a web page like that would give you that error.