# RailRoad problem

**URL:** <https://www.ruby-forum.com/t/railroad-problem/175591>\
**Category:** Rails\
**Created:** [September 16, 2009, 6:24am UTC](https://www.ruby-forum.com/t/railroad-problem/175591 "2009-09-16T06:24:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![little\_kostas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/f9ae1b/32.png) [@little\_kostas](https://www.ruby-forum.com/u/little_kostas)\
**Post date:** [September 16, 2009, 6:24am UTC](https://www.ruby-forum.com/t/railroad-problem/175591/1 "2009-09-16T06:24:04Z")

</div>

Hi guys!  
I am having a problem using railroad gem while running the command:  
railroad -C | neato -Tpng \> controllers.png

i get this error:  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active\_support/  
dependenci  
es.rb:445:in `load_missing_constant': uninitialized constant AdminSessionsContro ller (NameError) from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_suppo rt/dependencies.rb:77:in`const\_missing’  
from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/  
active\_suppo  
rt/dependencies.rb:89:in `const_missing' from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_suppo rt/inflector.rb:352:in`constantize’  
from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/  
active\_suppo  
rt/inflector.rb:351:in `each' from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_suppo rt/inflector.rb:351:in`constantize’  
from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/  
active\_suppo  
rt/core\_ext/string/inflections.rb:162:in `constantize' from c:/ruby/lib/ruby/gems/1.8/gems/railroad-0.5.0/lib/ railroad/controll ers_diagram.rb:28:in`generate’  
from c:/ruby/lib/ruby/gems/1.8/gems/railroad-0.5.0/lib/  
railroad/controll  
ers\_diagram.rb:24:in `each' from c:/ruby/lib/ruby/gems/1.8/gems/railroad-0.5.0/lib/ railroad/controll ers_diagram.rb:24:in`generate’  
from c:/ruby/lib/ruby/gems/1.8/gems/railroad-0.5.0/bin/  
railroad:47  
from c:/ruby/bin/railroad:19:in `load’  
from c:/ruby/bin/railroad:19

Any suggestions how to solve this???  
Thanx in advance  
Kostas L.

---

<div class="post-metadata">

**Author:** ![little\_kostas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/f9ae1b/32.png) [@little\_kostas](https://www.ruby-forum.com/u/little_kostas)\
**Post date:** [September 30, 2009, 8:54am UTC](https://www.ruby-forum.com/t/railroad-problem/175591/2 "2009-09-30T08:54:19Z")

</div>

Here is a hack of a fix I found:  
[http://d.hatena.ne.jp/zenpou/20081021/1224559643](http://d.hatena.ne.jp/zenpou/20081021/1224559643)

There is certainly a more elegant way to do this, but it got the job  
done when I needed to make some models right quick.

To summarize, from the link, in lib/railroad/app\_diagram.rb

make the following change:

## \< File.basename(filename).chomp(“.rb”).camelize

> ```
> if check_path
> prefix_class_names = filename.to_s.split(check_path).last
> File.dirname(prefix_class_names).each do | prefix_class_name |
> prefix_classes << prefix_class_name.camelize unless prefix_class_name.blank? || prefix_class_name == "."
> end
> prefix_classes << File.basename(filename).chomp(".rb").camelize
> end
> prefix_classes.join("::")
> 
> ```

Hope this is useful to someone
