我在本地機器上安裝了散落軌道應用程序https://github.com/diaspora/diaspora。然後,我安裝了Railroads圖生成器http://railroad.rubyforge.org/#download使用Railroad for Rails時出現兩個錯誤
按照網站上的說明,我構建了一個rake任務來運行它,但運行它時似乎收到兩個單獨的錯誤。
第一個錯誤是不存在的點命令:
sh: dot: command not found
第二個錯誤,而不耙運行時,我也得到:
Seans-MacBook-Pro:diaspora sean$ railroad -o models.dot -M
/Users/sean/.rvm/gems/[email protected]/gems/railroad- 0.5.0/lib/railroad/app_diagram.rb:54:in `disable_stdout': uninitialized constant AppDiagram::PLATFORM (NameError)
當我運行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/[email protected]/gems/railroad- 0.5.0/lib/railroad/app_diagram.rb:54:in `disable_stdout': uninitialized constant AppDiagram::PLATFORM (NameError)
from /Users/sean/.rvm/gems/[email protected]/gems/railroad- 0.5.0/lib/railroad/app_diagram.rb:72:in `load_environment'
from /Users/sean/.rvm/gems/[email protected]/gems/railroad-0.5.0/lib/railroad/app_diagram.rb:18:in `initialize'
from /Users/sean/.rvm/gems/[email protected]/gems/railroad-0.5.0/lib/railroad/models_diagram.rb:14:in `initialize'
from /Users/sean/.rvm/gems/[email protected]/gems/railroad-0.5.0/bin/railroad:36:in `new'
from /Users/sean/.rvm/gems/[email protected]/gems/railroad-0.5.0/bin/railroad:36:in `<top (required)>'
我還修改鐵路/ app_diagram.rb按此鏈接http://rubyforge.org/tracker/index.php?func=detail&aid=26418&group_id=3383&atid=12998
現在我收到此錯誤:
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/[email protected]/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/[email protected]/gems/railroad- 0.5.0/lib/railroad/app_diagram.rb:73:in `load_environment'
from /Users/sean/.rvm/gems/[email protected]
我從項目的根上運行,並且該文件存在。我也嘗試將.rb添加到app_diagram.rb文件中的行,但沒有更改。
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- [email protected]/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
感謝本傑明已經被更換。我現在已經安裝了它,但遇到了另一個錯誤。 – ardochhigh
使用自制軟件'brew install graphviz' – shantanoo