Open luizs81 opened 8 years ago
Could you try running the command string manually from the command line and see if that helps to troubleshoot? This doesn't look familiar.
I'm getting the same, even from directly triggering it:
railroady -lamM | sed -E 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' | dot -Tsvg > /somepath/doc/models_complete.svg
Error: <stdin>: syntax error in line 1 near '
Warning: syntax ambiguity - badly delimited number '1m' in line 1 of <stdin> splits into two tokens
Warning: syntax ambiguity - badly delimited number '36m' in line 1 of <stdin> splits into two tokens
Warning: syntax ambiguity - badly delimited number '1.2m' in line 1 of <stdin> splits into two tokens
Warning: syntax ambiguity - badly delimited number '0m' in line 1 of <stdin> splits into two tokens
...
Graphviz doesn't like digits in the beginning.
I am getting similar errors (using brew graphviz 2.38.0_1)
rake diagram:all --trace
bundle exec rake diagram:all --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
Generating /Users/lasto/clients/webify/teesforthepeople-api/doc/models_complete.svg
railroady -lamM | sed -E 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' | dot -Tsvg > /Users/lasto/clients/webify/teesforthepeople-api/doc/models_complete.svg
/Users/lasto/clients/webify/teesforthepeople-api/app/models/lab_color.rb:3: warning: already initialized constant LabColor
/Users/lasto/clients/webify/teesforthepeople-api/app/models/lab_color.rb:3: warning: previous definition of LabColor was here
Error: <stdin>: syntax error in line 1 near 'D'
Warning: syntax ambiguity - badly delimited number '-28T' in line 1 of <stdin> splits into two tokens
rake aborted!
Command failed with status (1): [railroady -lamM | sed -E 's/\x1B\[([0-9]{1...]
/Users/lasto/.rvm/gems/ruby-2.2.5@tees/gems/rake-11.2.2/lib/rake/file_utils.rb:69:in `block in create_shell_runner'
/Users/lasto/.rvm/gems/ruby-2.2.5@tees/gems/rake-11.2.2/lib/rake/file_utils.rb:59:in `call'
/Users/lasto/.rvm/gems/ruby-2.2.5@tees/gems/rake-11.2.2/lib/rake/file_utils.rb:59:in `sh'
/Users/lasto/.rvm/gems/ruby-2.2.5@tees/gems/rake-11.2.2/lib/rake/file_utils_ext.rb:37:in `sh'
/Users/lasto/.rvm/gems/ruby-2.2.5@tees/gems/railroady-1.5.1/tasks/railroady.rake:64:in `block (3 levels) in <top (required)>'
Also on: ruby-2.3.1 rails 4.2.6
rake diagram:all_with_engines
Generating /Users/mattlindsey/Documents/github/redeemify/doc/models_complete.svg
railroady -ilamzM | sed -E 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' | dot -Tsvg > /Users/mattlindsey/Documents/github/redeemify/doc/models_complete.svg
Error: <stdin>: syntax error in line 1 near '
Warning: syntax ambiguity - badly delimited number '1m' in line 1 of <stdin> splits into two tokens
Warning: syntax ambiguity - badly delimited number '36m' in line 1 of <stdin> splits into two tokens
I see this too - funny - it works for me in some rails projects but not others ... here's me splitting the command into three components:
tansaku@Samuels-MacBook-Pro:~/Documents/GitHub/StrawberryCanyon/redeemify (master)]$
→ railroady -lamM
ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
digraph models_diagram {
graph[overlap=false, splines=true, bgcolor="none"]
_diagram_info [shape="plaintext", label="Models diagram\lDate: Nov 01 2016 - 17:46\lMigration version: 20161030143818\lGenerated by RailRoady 1.5.1\lhttp://railroady.prestonlee.com\l", fontsize=13]
"AdminUser" [shape=Mrecord, label="{AdminUser|updated_at :timestamp without time zone\lemail :character varying\lencrypted_password :character varying\lreset_password_token :character varying\lreset_password_sent_at :timestamp without time zone\lremember_created_at :timestamp without time zone\lsign_in_count :integer\lcurrent_sign_in_at :timestamp without time zone\llast_sign_in_at :timestamp without time zone\lcurrent_sign_in_ip :character varying\llast_sign_in_ip :character varying\lcreated_at :timestamp without time zone\lid :integer\l}"]
"Provider" [shape=Mrecord, label="{Provider|removedCodes :integer\lname :character varying\lhistory :character varying\lprovider :character varying\lemail :character varying\lcreated_at :timestamp without time zone\lupdated_at :timestamp without time zone\lusedCodes :integer\luploadedCodes :integer\lunclaimCodes :integer\lid :integer\l}"]
"RedeemifyCode" [shape=Mrecord, label="{RedeemifyCode|email :character varying\lname :character varying\lcode :character varying\luser_id :integer\lprovider_id :integer\lcreated_at :timestamp without time zone\lupdated_at :timestamp without time zone\luser_name :character varying\lid :integer\l}"]
"User" [shape=Mrecord, label="{User|email :character varying\lprovider :character varying\luid :character varying\lname :character varying\lcreated_at :timestamp without time zone\lupdated_at :timestamp without time zone\lcode :character varying\lid :integer\l}"]
"Vendor" [shape=Mrecord, label="{Vendor|removedCodes :integer\lname :character varying\luid :character varying\lprovider :character varying\ldescription :character varying\lcreated_at :timestamp without time zone\lupdated_at :timestamp without time zone\lemail :character varying\lhistory :character varying\lwebsite :character varying\linstruction :character varying\lhelpLink :character varying\lcashValue :character varying\lexpiration :character varying\lusedCodes :integer\luploadedCodes :integer\lunclaimCodes :integer\lid :integer\l}"]
"VendorCode" [shape=Mrecord, label="{VendorCode|email :character varying\lcode :character varying\lvendor :character varying\lcreated_at :timestamp without time zone\lupdated_at :timestamp without time zone\lvendor_id :integer\luser_id :integer\lname :character varying\luser_name :character varying\lid :integer\l}"]
"Provider" -> "RedeemifyCode" [arrowtail=odot, arrowhead=crow, dir=both color="#DBBD5C"]
"User" -> "VendorCode" [arrowtail=odot, arrowhead=crow, dir=both color="#14C14F"]
"Vendor" -> "VendorCode" [arrowtail=odot, arrowhead=crow, dir=both color="#332BBB"]
}
[tansaku@Samuels-MacBook-Pro:~/Documents/GitHub/StrawberryCanyon/redeemify (master)]$
→ railroady -lamM | sed -E 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g'
ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
digraph models_diagram {
graph[overlap=false, splines=true, bgcolor="none"]
_diagram_info [shape="plaintext", label="Models diagram\lDate: Nov 01 2016 - 17:47\lMigration version: 20161030143818\lGenerated by RailRoady 1.5.1\lhttp://railroady.prestonlee.com\l", fontsize=13]
"AdminUser" [shape=Mrecord, label="{AdminUser|updated_at :timestamp without time zone\lemail :character varying\lencrypted_password :character varying\lreset_password_token :character varying\lreset_password_sent_at :timestamp without time zone\lremember_created_at :timestamp without time zone\lsign_in_count :integer\lcurrent_sign_in_at :timestamp without time zone\llast_sign_in_at :timestamp without time zone\lcurrent_sign_in_ip :character varying\llast_sign_in_ip :character varying\lcreated_at :timestamp without time zone\lid :integer\l}"]
"Provider" [shape=Mrecord, label="{Provider|removedCodes :integer\lname :character varying\lhistory :character varying\lprovider :character varying\lemail :character varying\lcreated_at :timestamp without time zone\lupdated_at :timestamp without time zone\lusedCodes :integer\luploadedCodes :integer\lunclaimCodes :integer\lid :integer\l}"]
"RedeemifyCode" [shape=Mrecord, label="{RedeemifyCode|email :character varying\lname :character varying\lcode :character varying\luser_id :integer\lprovider_id :integer\lcreated_at :timestamp without time zone\lupdated_at :timestamp without time zone\luser_name :character varying\lid :integer\l}"]
"User" [shape=Mrecord, label="{User|email :character varying\lprovider :character varying\luid :character varying\lname :character varying\lcreated_at :timestamp without time zone\lupdated_at :timestamp without time zone\lcode :character varying\lid :integer\l}"]
"Vendor" [shape=Mrecord, label="{Vendor|removedCodes :integer\lname :character varying\luid :character varying\lprovider :character varying\ldescription :character varying\lcreated_at :timestamp without time zone\lupdated_at :timestamp without time zone\lemail :character varying\lhistory :character varying\lwebsite :character varying\linstruction :character varying\lhelpLink :character varying\lcashValue :character varying\lexpiration :character varying\lusedCodes :integer\luploadedCodes :integer\lunclaimCodes :integer\lid :integer\l}"]
"VendorCode" [shape=Mrecord, label="{VendorCode|email :character varying\lcode :character varying\lvendor :character varying\lcreated_at :timestamp without time zone\lupdated_at :timestamp without time zone\lvendor_id :integer\luser_id :integer\lname :character varying\luser_name :character varying\lid :integer\l}"]
"Provider" -> "RedeemifyCode" [arrowtail=odot, arrowhead=crow, dir=both color="#D3E424"]
"User" -> "VendorCode" [arrowtail=odot, arrowhead=crow, dir=both color="#695F0C"]
"Vendor" -> "VendorCode" [arrowtail=odot, arrowhead=crow, dir=both color="#D4B48C"]
}
[tansaku@Samuels-MacBook-Pro:~/Documents/GitHub/StrawberryCanyon/redeemify (master)]$
→ railroady -lamM | sed -E 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' | dot -Tsvg
Error: <stdin>: syntax error in line 1 near '
Warning: syntax ambiguity - badly delimited number '1m' in line 1 of <stdin> splits into two tokens
Warning: syntax ambiguity - badly delimited number '36m' in line 1 of <stdin> splits into two tokens
Warning: syntax ambiguity - badly delimited number '0.4m' in line 1 of <stdin> splits into two tokens
Warning: syntax ambiguity - badly delimited number '0m' in line 1 of <stdin> splits into two tokens
Warning: syntax ambiguity - badly delimited number '1m' in line 1 of <stdin> splits into two tokens
Warning: syntax ambiguity - badly delimited number '0m' in line 1 of <stdin> splits into two tokens```
funny thing is that the tokens it is complaining about don't appear in the last stage of the output ...
Clue. Something in the Railroady code seems to be outputting this line first, which causes dot to fail:
^[[1m^[[36mActiveRecord::SchemaMigration Load (0.6ms)^[[0m ^[[1mSELECT "schema_migrations".* FROM "schema_migrations"^[[0m
I am running in to this issue as well. Some work, some don't, like @tansaku says.
@roeintense Right, it depends on Rails logging and maybe some other settings. Try the fork in #116 (could we please get that merged?).
Seems this all relates to ActiveRecord logging. Simple solution that worked for me was to set the ActiveRecord logger to nil
in config/environments/development.rb
when running railroady:
Rails.application.configure do
config.log_level = :debug
config.active_record.logger = Logger.new(STDOUT)
config.active_record.logger.level = config.log_level
if $0 =~ /(rake|railroady|erd)$/
config.active_record.logger = nil
end
end
@joelvh Please see #116, which essentially does the same thing without resorting to parsing the command line.
@marnen once that's merged, it may help. However, if there is an AR logger and the log level is debug
, there will still be artifacts interfering with the output piped to the other commands.
@joelvh Are you saying that AR logging in Rails doesn't necessarily come through the Rails logger? That's the only case I could think of in which your last comment would be accurate.
Are folks ok with merging in PR #116?
Output from logging is what is tripping it up for me as well, so silencing the logger seems like an okay solution.
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14] Rails 4.1.11