Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rake erd stops working after upgrading to Yosemite #87

Closed
bigos opened this issue Nov 7, 2014 · 12 comments
Closed

rake erd stops working after upgrading to Yosemite #87

bigos opened this issue Nov 7, 2014 · 12 comments

Comments

@bigos
Copy link

bigos commented Nov 7, 2014

anybody got bitten by this problem yet?

$ brew install graphviz
==> Installing graphviz dependency: libpng
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/libpng-1.6.13.yosemite.bottle.tar.gz

################################################################## 100.0%

==> Pouring libpng-1.6.13.yosemite.bottle.tar.gz
🍺 /usr/local/Cellar/libpng/1.6.13: 17 files, 1.2M
==> Installing graphviz
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/graphviz-2.38.0.yosemite.bottle.1.tar.gz

################################################################## 100.0%

==> Pouring graphviz-2.38.0.yosemite.bottle.1.tar.gz
🍺 /usr/local/Cellar/graphviz/2.38.0: 469 files, 68M

$ rake erd
Loading application environment...
Loading code in search of Active Record models...
Generating Entity-Relationship Diagram for 51 models...
rake aborted!
NoMethodError: undefined method `clear?' for #RailsERD::Domain::Attribute:0x007fa81f2cd610

@bigos
Copy link
Author

bigos commented Nov 7, 2014

After running:

rvm reinstall all
brew reinstall postgresql92
ARCHFLAGS="-arch x86_64" gem install pg

the error has chnged to:
$ rake erd
Loading application environment...
Loading code in search of Active Record models...
Generating Entity-Relationship Diagram for 51 models...
Warning: Ignoring invalid model ActiveRecord::SessionStore::Session (PG::InvalidParameterValue: ERROR: invalid value for parameter "TimeZone": "UTC"
: SET time zone 'UTC')

@bigos
Copy link
Author

bigos commented Nov 7, 2014

after restarting the computer it went back to the original error.

@bigos
Copy link
Author

bigos commented Nov 7, 2014

running
$ gem uninstall rails-erd
didn't help

@bf4
Copy link
Collaborator

bf4 commented Nov 7, 2014

Can you provide sample code for this error? Otherwise it's hard to debug.

@bigos
Copy link
Author

bigos commented Nov 7, 2014

it might be related to issue:
#65

when i try a workaround I get this error:

$ erd --inheritance --direct --attributes=foreign_keys,content --filetype=dot
Loading application in 'sku_store_0_0'...
WARN: Unresolved specs during Gem::Specification.reset:
activerecord (>= 3.0)
i18n (>= 0.6.9, > 0.6)
tzinfo (
> 1.1)
minitest (~> 5.1)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
Failed: Gem::LoadError: You have already activated activesupport 4.1.6, but your Gemfile requires activesupport 4.1.5. Prepending bundle exec to your command may solve this.

@bf4
Copy link
Collaborator

bf4 commented Nov 7, 2014

@bigos did you attend to the error message? Prepending bundle exec to your command may solve this.? Also, as I wrote above, we need some code we can run against to reproduce this. At least share a backtrace, which ruby you're on, and which rails-erd version

@bigos
Copy link
Author

bigos commented Nov 7, 2014

this is with bundle exec prepended:

$ bundle exec erd --inheritance --direct --attributes=foreign_keys,content --filetype=dot
Loading application in 'sku_store_0_0'...
Generating entity-relationship diagram for 51 models...
Failed: NoMethodError: undefined method `clear?' for #RailsERD::Domain::Attribute:0x0000010911f9b8

I have the same problem on Linux Mint 17 machine. so it might not be Yosemite specific.

@bigos
Copy link
Author

bigos commented Nov 7, 2014

this one was ran on Linux:

rake erd --trace
** Invoke erd (first_time)
** Invoke erd:generate (first_time)
** Invoke erd:options (first_time)
** Execute erd:options
** Invoke erd:load_models (first_time)
** Execute erd:load_models
Loading application environment...
** Invoke environment (first_time)
** Execute environment
Loading code in search of Active Record models...
** Execute erd:generate
Generating Entity-Relationship Diagram for 51 models...
rake aborted!
NoMethodError: undefined method clear?' for #<RailsERD::Domain::Attribute:0xe697388> /home/jacek/.rvm/gems/ruby-2.1.1@skustore-0-0/bundler/gems/rails-erd-9ccb094fa29b/lib/rails_erd/diagram.rb:180:inblock (2 levels) in filtered_attributes'

@bigos
Copy link
Author

bigos commented Nov 7, 2014

I found it. It's a term-ansicolor related issue. Removing term-ansicolor gem and requirements of it in the code lets me to generete erd pdf files on Yosemite.

Now the question is how we can colorize our logs and keep the rake-erd?

@bf4
Copy link
Collaborator

bf4 commented Nov 7, 2014

there's lots of gems for ansi colors, like rainbow. or just write your own
https://github.com/bf4/toot/blob/master/lib/colorize.rb (p.s you probably
don't want to colorize your logs except maybe in dev)

@bigos bigos closed this as completed Nov 8, 2014
@bigos
Copy link
Author

bigos commented Nov 10, 2014

Switching a gem is not an option for my team. I'll just uncomment
include Term::ANSIColor
in my development.rb before running rake erd. It seems to be a reasonable workaround.

@bf4
Copy link
Collaborator

bf4 commented Nov 11, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants