preston / railroady

Ruby on Rails 3/4/5 model and controller UML class diagram generator. (`brew/port/apt-get install graphviz` before use!)
Other
1.72k stars 142 forks source link

Gem not working for Rails 4 #47

Closed sheerun closed 10 years ago

sheerun commented 11 years ago
Generating /Users/sheerun/Projects/team-project/doc/models_complete.svg
railroady -ilamM | sed -E 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' | dot -Tsvg > /Users/sheerun/Projects/team-project/doc/models_complete.svg
sh: /Users/sheerun/Projects/team-project/doc/models_complete.svg: No such file or directory
rake aborted!
Command failed with status (1): [railroady -ilamM | sed -E 's/\x1B\[([0-9]{...]

Tasks: TOP => diagram:all => diagram:models:complete
(See full trace by running task with --trace)
preston commented 11 years ago

Could you post the full stack trace? Not sure anyone has tested with 4.0.0.rc1 yet.

DHB commented 11 years ago

Out of curiosity - I checked on my system(s) with rails 4.0.0.rc1 under MRI ruby 2.0.0p0 and ruby 2.0.0p195.

This was on Ubuntu 12.04 LTS.

The command (from git bash) worked without any problem.

railroady -ilamM | sed -E 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' | dot -Tsvg > /home/development/workspace/r4-test/test.svg

Checked on Windows7 - the same ... no problem ... I created controller and model diagrams as *.dot, *.svg and also converted to `*.png``.

For Windows the little hack in #45 had to be applied.

RobertAudi commented 11 years ago

I had this issue as well with Rails 4. The rake task failed with the same error. However, the command supplied by @DHB worked. I managed to fix it by creating the doc/ folder. The issue only appears if the doc/ folder is not there.

mccollek commented 11 years ago

I can confirm this; creating the '/doc' directory in your application allows the command to run on both Rails4/Ruby2 and Rails3/Ruby1.9.3

sheerun commented 11 years ago

The fix would be to create doc folder automatically I guess?

preston commented 11 years ago

Yeah I'm sure it's an easy fix. I don't have time right now but I'll try to get to it soon.

gaudibr commented 10 years ago

I am getting the following error, after applying the patched described here and enabling mingw32 on railroady.rake,

railroady -ilamM | sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' | dot -Tsvg > C:/Users/s27/GitHub/typo/doc/models_complete.svg
'K]' is not recognized as an internal or external command,
operable program or batch file.
rake aborted!
Command failed with status (255): [railroady -ilamM | sed -r 's/\x1B\[([0-9]{...]

not sure what the issue is since I am not a big fan of regex, but it seems the problem is in parsing the expression.

miketheman commented 10 years ago

This has been open for a while, and largely revolves around a missing doc/ folder. I believe that adding either a single method to create_doc_if_missing or adding logic to https://github.com/preston/railroady/blob/master/tasks/railroady.rake#L22 to create the directory.

If either of these solutions is desired, please let me know, and I'll be happy to work up a PR.

preston commented 10 years ago

This should be fixed in 1.1.2.

micahlisonbee commented 9 years ago

This issue reappears in 4.2.0, I manually added the doc folder and it worked.