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.71k stars 142 forks source link

Issues running on x64_mingw #82

Closed biximilien closed 8 years ago

biximilien commented 9 years ago

Hi,

Im receiving the following error message when attempting to run rake diagram:all on x64_mingw platform. GraphViz is installed and on PATH.

Here is the trace:

* Invoke diagram:all (first_time) * Invoke diagram:setup:create_new_doc_folder_if_needed (first_time) * Execute diagram:setup:create_new_doc_folder_if_needed * Invoke diagram:models:complete (first_time) \ Execute diagram:models:complete railroady -lamM | sed -r 's/\x1B[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' | dot -Tsvg > C:/Users/Maxime/Documents/wild-compass/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 -lamM | sed -r 's/\x1B[([0-9]{1...] c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/file_utils.rb:66:in block in create_shell_runner' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/file_utils.rb:57:incall' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/file_utils.rb:57:in sh' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/file_utils_ext.rb:37:insh' c:/Ruby21-x64/lib/ruby/gems/2.1.0/bundler/gems/railroady-490a01646523/tasks/railroady.rake:65:in block (3 levels) in <top (required)>' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:incall' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in block in execute' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:ineach' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in execute' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:inblock in invoke_with_call_chain' c:/Ruby21-x64/lib/ruby/2.1.0/monitor.rb:211:in mon_synchronize' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:ininvoke_with_call_chain' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:201:in block in invoke_prerequisites' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:199:ineach' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:199:in invoke_prerequisites' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:178:inblock in invoke_with_call_chain' c:/Ruby21-x64/lib/ruby/2.1.0/monitor.rb:211:in mon_synchronize' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:ininvoke_with_call_chain' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in invoke' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:150:ininvoke_task' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in block (2 levels) in top_level' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:ineach' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in block in top_level' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:115:inrun_with_threads' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:100:in top_level' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:78:inblock in run' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:176:in standard_exception_handling' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:75:inrun' c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rake-10.4.2/bin/rake:33:in <top (required)>' c:/Ruby21-x64/bin/rake:23:inload' c:/Ruby21-x64/bin/rake:23:in `

' Tasks: TOP => diagram:all => diagram:models:complete Generating C:/Users/Maxime/Documents/wild-compass/doc/models_complete.svg

preston commented 9 years ago

Are you seeing railroady, sed, and dot all on your PATH? All three are necessary.

biximilien commented 9 years ago

Hmm, they do seem to be on path.

Sorry for the late response.

RobertMaaskant commented 8 years ago

The problem is in the rake file. Windows sees a pipe symbol in the string passed to the -r option. If you enclose that string in double quotation marks, it does work. Not sure if this would break things in other operating systems.

So change the self.sed in railroady.rake to:

def self.sed regex = 's/\x1B[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' case RbConfig::CONFIG['host_os'] when /linux|cygwin|mingw|mingw32/ return "sed -r \"#{regex}\"" when /mac|darwin|bsd/ return "sed -E '#{regex}'" else fail NotImplementedError end

preston commented 8 years ago

I'm happy to merge this if someone would like to submit a non-breaking patch. I (fortunately) don't have a straightforward way to test Windows-specific changes. :)

RobertMaaskant commented 8 years ago

The suggested change is working for me on windows. I would be willing to submit a patch, but I don't know how to test that it is non-breaking (as mentioned in my previous post). Could you point me in the right direction?

preston commented 8 years ago

If you want to break the "linux" part of that when into a separate when (so all the Windows stuff is separate), we should be fine. I'm happy to verify on OS X and Ubuntu.

preston commented 8 years ago

Can I close this out? If there are no outstanding patches I'd like to clear up the issue tracker a bit..

RobertMaaskant commented 8 years ago

The patch was merged, so yes, this issue can be closed On Feb 9, 2016 4:58 PM, "Preston Lee" notifications@github.com wrote:

Can I close this out? If there are no outstanding patches I'd like to clear up the issue tracker a bit..

— Reply to this email directly or view it on GitHub https://github.com/preston/railroady/issues/82#issuecomment-181926125.