# Problem with showing image

**URL:** <https://www.ruby-forum.com/t/problem-with-showing-image/148200>\
**Category:** Rails\
**Created:** [September 10, 2008, 12:14pm UTC](https://www.ruby-forum.com/t/problem-with-showing-image/148200 "2008-09-10T12:14:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jicksta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ba0ec/32.png) [@jicksta](https://www.ruby-forum.com/u/jicksta)\
**Post date:** [September 10, 2008, 12:14pm UTC](https://www.ruby-forum.com/t/problem-with-showing-image/148200/1 "2008-09-10T12:14:42Z")

</div>

Hi I’m using \<%= image\_tag(“nameofimage.png”) %\> to load image in my  
page and picture is there and it loads very rarely but most of the time  
(almost all the time) it doesn’t. What can be the cause for it. Also I  
tried ![](https://www.ruby-forum.com/public/images/nameofimage.png) stille can’t get the  
picture though the picture is situated under “///nameofimage.png”. Thanks

---

<div class="post-metadata">

**Author:** ![jicksta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ba0ec/32.png) [@jicksta](https://www.ruby-forum.com/u/jicksta)\
**Post date:** [September 10, 2008, 12:26pm UTC](https://www.ruby-forum.com/t/problem-with-showing-image/148200/2 "2008-09-10T12:26:01Z")

</div>

On 10 Sep 2008, at 11:14, Jay P. wrote:

> Hi I’m using \<%= image\_tag(“nameofimage.png”) %\> to load image in my  
> page and picture is there and it loads very rarely but most of the  
> time  
> (almost all the time) it doesn’t. What can be the cause for it. Also I  
> tried ![](https://www.ruby-forum.com/public/images/nameofimage.png) stille can’t get the  
> picture though the picture is situated under “///nameofimage.png”. Thanks

the leading /public isn’t necessary. Your web server’s Documentroot  
should be public (not the project) folder. mongrel, script/server  
etc… should do that by themselves

Fred

---

<div class="post-metadata">

**Author:** ![jicksta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ba0ec/32.png) [@jicksta](https://www.ruby-forum.com/u/jicksta)\
**Post date:** [September 10, 2008, 1:50pm UTC](https://www.ruby-forum.com/t/problem-with-showing-image/148200/3 "2008-09-10T13:50:54Z")

</div>

thanks for the reply man but doesn’t help.

---

<div class="post-metadata">

**Author:** ![jicksta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ba0ec/32.png) [@jicksta](https://www.ruby-forum.com/u/jicksta)\
**Post date:** [September 10, 2008, 1:56pm UTC](https://www.ruby-forum.com/t/problem-with-showing-image/148200/4 "2008-09-10T13:56:25Z")

</div>

On 10 Sep 2008, at 12:50, Jay P. wrote:

> thanks for the reply man but doesn’t help.

Firebug and things like that allow you to server responses for all of  
your requests. I suggest you look at that to find out why your images  
aren’t loading.

Fred

---

<div class="post-metadata">

**Author:** ![jicksta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ba0ec/32.png) [@jicksta](https://www.ruby-forum.com/u/jicksta)\
**Post date:** [September 10, 2008, 2:59pm UTC](https://www.ruby-forum.com/t/problem-with-showing-image/148200/5 "2008-09-10T14:59:55Z")

</div>

On Wed, Sep 10, 2008 at 3:14 AM, Jay P. \<  
removed\_email\_address@domain.invalid\> wrote:

> Hi I’m using \<%= image\_tag(“nameofimage.png”) %\> to load image in my  
> page and picture is there and it loads very rarely but most of the time  
> (almost all the time) it doesn’t. What can be the cause for it. Also I  
> tried ![](https://www.ruby-forum.com/public/images/nameofimage.png) stille can’t get the  
> picture though the picture is situated under “///nameofimage.png”. Thanks

Hi, what version of Rails are you using? What does the following  
produce in  
script/console:

helper.image\_tag( ‘nameofimage.png’ )

-Conrad

---

<div class="post-metadata">

**Author:** ![jicksta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ba0ec/32.png) [@jicksta](https://www.ruby-forum.com/u/jicksta)\
**Post date:** [September 11, 2008, 1:58am UTC](https://www.ruby-forum.com/t/problem-with-showing-image/148200/6 "2008-09-11T01:58:54Z")

</div>

Conrad T. wrote:

> Hi, what version of Rails are you using? What does the following  
> produce in  
> script/console:
> 
> helper.image\_tag( ‘nameofimage.png’ )
> 
> -Conrad

Thank Conrad for the help, I tried using script/console and it says its  
Rails 2.0.2 but doesn’t go well, it ends up with the message: irb.bat is  
not recognized as an internal or external command, operable program or  
batch file.

---

<div class="post-metadata">

**Author:** ![jicksta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ba0ec/32.png) [@jicksta](https://www.ruby-forum.com/u/jicksta)\
**Post date:** [September 11, 2008, 1:56am UTC](https://www.ruby-forum.com/t/problem-with-showing-image/148200/7 "2008-09-11T01:56:00Z")

</div>

Frederick C. wrote:

> On 10 Sep 2008, at 12:50, Jay P. wrote:
> 
> > thanks for the reply man but doesn’t help.
> 
> Firebug and things like that allow you to server responses for all of  
> your requests. I suggest you look at that to find out why your images  
> aren’t loading.
> 
> Fred

Thanks again Fred for the reply, I don’t know where can I find that  
firebug as I don’t use firefox, however, I tried it, and suprisingly it  
worked fine, so the problem is only with IE, its faster in firefox as  
well. So, what can be a solution for IE. Somewhere I read that in IE  
there will be yellow triangle in the bottom left if there are any errors  
but couldn’t find any, so may be there’s no error but still the page  
doesn’t load. Thanks

---

<div class="post-metadata">

**Author:** ![jicksta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ba0ec/32.png) [@jicksta](https://www.ruby-forum.com/u/jicksta)\
**Post date:** [September 11, 2008, 8:54am UTC](https://www.ruby-forum.com/t/problem-with-showing-image/148200/8 "2008-09-11T08:54:26Z")

</div>

On Wed, Sep 10, 2008 at 4:58 PM, Jay P. \<  
removed\_email\_address@domain.invalid\> wrote:

> Thank Conrad for the help, I tried using script/console and it says its  
> Rails 2.0.2 but doesn’t go well, it ends up with the message: irb.bat is  
> not recognized as an internal or external command, operable program or  
> batch file.

Hi Jay, if you’re running on Windows, then try executing the command in  
the  
root folder of your Rails application

ruby.exe script\console

Note: Please make sure that the parent directory of ruby.exe is in your  
path.

Good luck,

-Conrad
