1

I've installed the diaspora rails application https://github.com/diaspora/diaspora on my local machine. Then I installed the Railroads diagram generator http://railroad.rubyforge.org/#download

Following the instructions on the site, I built a rake task to run it, but appear to be getting two separate errors when I run it.

The first error is the absence of the dot command:

sh: dot: command not found

The second error I also get when running without rake:

Seans-MacBook-Pro:diaspora sean$ railroad -o models.dot -M 
/Users/sean/.rvm/gems/ruby-1.9.3-p194@diaspora/gems/railroad-    0.5.0/lib/railroad/app_diagram.rb:54:in `disable_stdout': uninitialized constant     AppDiagram::PLATFORM (NameError)

When I run rake:

Seans-MacBook-Pro:diaspora sean$ rake doc:diagrams
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
railroad -i -l -a -m -M | dot -Tsvg | sed 's/font-size:14.00/font-size:11.00/g' >  doc/models.svg
sh: dot: command not found
/Users/sean/.rvm/gems/ruby-1.9.3-p194@diaspora/gems/railroad-    0.5.0/lib/railroad/app_diagram.rb:54:in `disable_stdout': uninitialized constant    AppDiagram::PLATFORM (NameError)
from /Users/sean/.rvm/gems/ruby-1.9.3-p194@diaspora/gems/railroad-  0.5.0/lib/railroad/app_diagram.rb:72:in `load_environment'
from /Users/sean/.rvm/gems/ruby-1.9.3-p194@diaspora/gems/railroad-0.5.0/lib/railroad/app_diagram.rb:18:in `initialize'
from /Users/sean/.rvm/gems/ruby-1.9.3-p194@diaspora/gems/railroad-0.5.0/lib/railroad/models_diagram.rb:14:in `initialize'
from /Users/sean/.rvm/gems/ruby-1.9.3-p194@diaspora/gems/railroad-0.5.0/bin/railroad:36:in `new'
from /Users/sean/.rvm/gems/ruby-1.9.3-p194@diaspora/gems/railroad-0.5.0/bin/railroad:36:in `<top (required)>'

I also modified railroad/app_diagram.rb as per this link http://rubyforge.org/tracker/index.php?func=detail&aid=26418&group_id=3383&atid=12998

Now I am getting this error:

Seans-MacBook-Pro:diaspora sean$ rake doc:diagrams
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
railroad -i -l -a -m -M | dot -Tsvg | sed 's/font-size:14.00/font-size:11.00/g' >   doc/models.svg
dyld: Library not loaded: /usr/lib/libltdl.7.dylib
  Referenced from: /usr/local/bin/dot
  Reason: image not found
  Error loading application environment.
 (Are you running railroad on the aplication's root directory?)

/Users/sean/.rvm/gems/ruby-1.9.3-p194@diaspora/gems/railroad-0.5.0/lib/railroad/app_diagram.rb:73:in `require': cannot load such file --    config/environment (LoadError)
from /Users/sean/.rvm/gems/ruby-1.9.3-p194@diaspora/gems/railroad-  0.5.0/lib/railroad/app_diagram.rb:73:in `load_environment'
from /Users/sean/.rvm/gems/ruby-1.9.3-p194@diaspo

I am running from the project root, and the file exists. I also tried adding .rb to the line in the app_diagram.rb file but no change.

Seans-MacBook-Pro:diaspora sean$ pwd
/Users/sean/Dropbox/rails/diaspora

Seans-MacBook-Pro:diaspora sean$ head -73 /Users/sean/.rvm/gems/ruby-1.9.3-    p194@diaspora/gems/railroad-0.5.0/lib/railroad/app_diagram.rb
 | tail -1
      require "config/environment"

Seans-MacBook-Pro:diaspora sean$ ls -l config/environment.rb
-rw-r--r--  1 sean  staff  1481 Jul 19 14:25 config/environment.rb
Kevin Brown-Silva
  • 40,873
  • 40
  • 203
  • 237
port5432
  • 5,889
  • 10
  • 60
  • 97

2 Answers2

4

This is the program you need: http://www.graphviz.org/Download_macos.php. Dot is the program which is required to draw the graphs.

Benjamin Tan Wei Hao
  • 9,621
  • 3
  • 30
  • 56
0

OK I think I found the answer, under another SO question. RailRoad is not working. Giving me issues ie /railroad-0.5.0/lib/railroad/app_diagram.rb:54:in `disable_stdout': uninitialized constant

It's no longer maintained and has been replaced by https://github.com/preston/railroady#readme

Community
  • 1
  • 1
port5432
  • 5,889
  • 10
  • 60
  • 97