有人使用RailRoad图生成器吗?

时间:2008-10-22 13:02:22

标签: ruby-on-rails ruby gem

我最近安装了RailRoad gem来生成应用程序模型和控制器的.svg图。

rake任务不断出现类似的错误:

1.8/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:263:in `load_missing_constant': uninitialized constant

我在2个单独的应用程序上尝试了rake任务,并且错误仍然以不同的“常量”名称出现。

任何使用它的人有类似的问题吗?

4 个答案:

答案 0 :(得分:2)

我正在运行它没有任何问题(虽然我必须快速编辑,因为它代表了乌鸦脚错误的方式)。

此问题also appears to be in their tracker。我会继续将你的堆栈跟踪添加到该票证中。我很好奇这是你的ActiveSupport版本吗? Bur你的版本和正在使用的版本都显示相同的问题,所以必须在某处有相似之处。

答案 1 :(得分:1)

Ivan和其他人尝试使用Github的Bryan Larsen版本:http://github.com/bryanlarsen/railroad

答案 2 :(得分:0)

你能发布完整的堆栈跟踪吗?我想知道你今天和我有同样的问题:

user@laptop:11:15 AM:rails_app> rake doc:diagrams
(in /Users/ivan/Sites/lqas)
railroad -i -l -a -m -M | dot -Tsvg | sed 's/font-size:14.00/font-size:11.00/g' > doc/models.svg
railroad -i -l -C | neato -Tsvg | sed 's/font-size:14.00/font-size:11.00/g' > doc/controllers.svg
Error loading controller classes.
  (Are you running railroad on the aplication's root directory?)

/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- app/controllers/application.rb (MissingSourceFile)
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
        from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
        from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
        from /usr/local/lib/ruby/gems/1.8/gems/railroad-0.5.0/lib/railroad/controllers_diagram.rb:39:in `load_classes'
        from /usr/local/lib/ruby/gems/1.8/gems/railroad-0.5.0/lib/railroad/app_diagram.rb:21:in `initialize'
        from /usr/local/lib/ruby/gems/1.8/gems/railroad-0.5.0/lib/railroad/controllers_diagram.rb:14:in `initialize'
        from /usr/local/lib/ruby/gems/1.8/gems/railroad-0.5.0/bin/railroad:38:in `new'
        from /usr/local/lib/ruby/gems/1.8/gems/railroad-0.5.0/bin/railroad:38
        from /usr/local/bin/railroad:19:in `load'
        from /usr/local/bin/railroad:19

我必须在lib / railroad / controllers_diagram.rb中注释掉这一行,它在那里查找applicaton.rb而不是application_controller.rb,因为它现在被调用。

答案 3 :(得分:0)

我猛地抬头让铁路工作终于遇到了rails-erd gem。它像一个魅力一样唤醒。会把它推荐给铁路的所有问题。