# Bug on autoload

**URL:** <https://www.ruby-forum.com/t/bug-on-autoload/116229>\
**Category:** Development\
**Created:** [October 3, 2007, 5:29pm UTC](https://www.ruby-forum.com/t/bug-on-autoload/116229 "2007-10-03T17:29:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hidetoshi\_NAGAI](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/49beb7/32.png) [@Hidetoshi\_NAGAI](https://www.ruby-forum.com/u/Hidetoshi_NAGAI)\
**Post date:** [October 3, 2007, 5:29pm UTC](https://www.ruby-forum.com/t/bug-on-autoload/116229/1 "2007-10-03T17:29:51Z")

</div>

e$B1J0f!wCNG=!%6e9)Bg$G$9!%e(B

[ruby-dev:31923]e$B$G$b?($l$?7o$G$9$,!$e(B1.9 e$B$G!$Nc$($Pe(B

## ----\<hoge.rb\>------------------------------- class HOGE; end

e$B$G$"$k$H$-!$e(Bautoload :HOGE, ‘hoge.rb’ e$B$H@\_Dj$7$?8e$Ge(B  
require ‘hoge.rb’ e$B$H$9$k$H!$e(B

* * *

## NameError: uninitialized constant HOGE from /home/nagai/Ruby-work/hoge.rb:1:in `\<top (required)\>’

e$B$H$$$&$h$&$KNc30$,@8$8$F!$@5$7$/FI$`$3$H$,$G$-$^$;$s!%e(B  
e$B$J$\*!$e(B1.8 e$B$G$ONc30$H$O$J$j$^$;$s!%e(B

require e$B$r$;$:$Ke(B HOGE.new  
e$B$J$I$HMQ$$$?\>l9g$K$ONc30$O@8$8$^$;$s!%e(B  
autoload e$B$He(B require  
e$B$H$,\>WFM$7$?\>l9g$K%H%i%V%k$K$J$k$h$&$G$9!%e(B

e$B$J$+$J$+=$@5$5$l$J$$$h$&$G$9$N$G5$$K$J$C$F%a!\<%k$7$^$7$?$,!$e(B  
known bug e$B$G4{$K:#8e$N=$@57W2h$KF~$C$F$$$k$N$G$7$?$i$4$a$s$J$5$$!%e(B
