Since you say that you are a beginner, I will explain this in detail. This statement:
@cart = Cart.find(params[:id])
It means "look in the database and find the cart with the identifier X". However, when you do this:
<%= link_to(image_tag("cart.png"),cart_path) %>
You do not provide this identifier. That is why it gives you this error.
I don't know how your routes are defined, but you can do something like this:
<%= link_to(image_tag("cart.png"),cart_path(cart_id_here) %>
What a way to say: "path to cart with identifier X".