Comments (16)
Hi! Thanks for posting this issue. The problem appears that Graphviz was compiled without PDF support. This happens automatically when it is installed when Cairo/Pango were not available. The order of installing Cairo, Pango and Graphviz actually is important...
You can try the following:
- Uninstall Cairo, Pango and Graphviz (
brew uninstall cairo pango graphviz
) - Install Cairo, Pango and Graphviz, exactly in this order (
brew install cairo pango graphviz
)
This should give you support for PDF files in Graphviz. Hope this helps!
from rails-erd.
This did it for me (with prior uninstall if needed):
brew install cairo pango
brew install graphviz --with-pangocairo
from rails-erd.
Many many thanks. It worked.
from rails-erd.
I have 10.7.4 and have followed these instructions but it still does not work ?
brew install graphviz --with-pangocairo
in the Making install in pango
section:
CC gvloadimage_pango.lo
/bin/sh ../../libtool --silent --tag=CC --mode=compile /usr/bin/llvm-gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../lib/common -I../../lib/pathplan -I../../lib/gvc -I../../lib/graph -I../../lib/cdt -I/usr/X11/include/freetype2 -I/usr/X11/include -I/include -I/usr/local/Cellar/cairo/1.12.2/include -I/usr/local/Cellar/pixman/0.26.2/include -I/usr/local/Cellar/libffi/3.0.11/include -I/usr/local/Cellar/gettext/0.18.1.1/include -isystem /usr/local/include -I/usr/local/Cellar/graphviz/2.28.0/include -Os -w -pipe -mmacosx-version-min=10.7 -march=core2 -msse4 -fno-common -Wall -c -o gvloadimage_pango.lo gvloadimage_pango.c
gvtextlayout_pango.c:23:30: error: pango/pangocairo.h: No such file or directory
In file included from gvtextlayout_pango.c:24:
from rails-erd.
It appears that the latest OS X Lion has an old version of Cairo:
This formula is keg-only, so it was not symlinked into /usr/local.
Mac OS X already provides this program and installing another version in
parallel can cause all kinds of trouble.
The Cairo provided by Leopard is too old for newer software to link against.
Generally there are no consequences of this for you.
If you build your own software and it requires this formula, you'll need
to add its lib & include paths to your build variables:
LDFLAGS -L/usr/local/Cellar/cairo/1.12.2/lib
CPPFLAGS -I/usr/local/Cellar/cairo/1.12.2/include
I was able to install graphviz with pangocairo (pdf support) via brew on OS X on 10.7.4:
brew install cairo pango
(...)
LDFLAGS=-L/usr/local/Cellar/cairo/1.12.2/lib CPPFLAGS=-I/usr/local/Cellar/cairo/1.12.2/include brew install graphviz --with-pangocairo
from rails-erd.
I tried you command and still get the same error
from rails-erd.
also make sure you uninstall everything before trying (brew uninstall cairo pango graphviz)
from rails-erd.
@jipiboily your solution works~ thanks
from rails-erd.
FYI when I try to run brew install graphviz --with-pangocairo
(per @jipiboily's suggestion) with the latest homebrew updates (after making sure cairo, pango, and graphviz have all been uninstalled), it issues a warning:
Warning: graphviz: --with-pangocairo was deprecated; using --with-pango instead!
The compilation/installation completes successfully but the end result is still a Graphviz that can't handle PDFs:
rake aborted!
Saving diagram failed!
Graphviz produced errors. Verify it has support for filetype=pdf, or use filetype=dot.
Original error: Error: in routesplines, cannot find NORMAL edge
.../gems/rails-erd-1.3.0/lib/rails_erd/diagram/graphviz.rb:202:in `rescue in block in <class:Graphviz>'
.../gems/rails-erd-1.3.0/lib/rails_erd/diagram/graphviz.rb:197:in `block in <class:Graphviz>'
.../gems/rails-erd-1.3.0/lib/rails_erd/diagram.rb:142:in `instance_eval'
.../gems/rails-erd-1.3.0/lib/rails_erd/diagram.rb:142:in `save'
.../gems/rails-erd-1.3.0/lib/rails_erd/diagram.rb:120:in `create'
.../gems/rails-erd-1.3.0/lib/rails_erd/diagram.rb:74:in `create'
.../gems/rails-erd-1.3.0/lib/rails_erd/tasks.rake:41:in `block (2 levels) in <top (required)>'
.../bin/ruby_executable_hooks:15:in `eval'
.../bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => erd => erd:generate
from rails-erd.
I have been facing the same issue. I am unable to create png or pdf of the dot files. I tried all the above solutions and none of them worked for me.
from rails-erd.
@smenon8 what errors are you getting? Can you give us more information, please?
from rails-erd.
I'm on Yosemite (10.10.5), and this worked for me...
brew uninstall pango cairo graphviz
brew install cairo pango
brew install graphviz --with-pango --with-cairo
from rails-erd.
I'm on MacOS Sierra (10.12.4) and the only way I could get past this error was by building from the sources.
Downloaded the source tarball from here:
http://www.graphviz.org/pub/graphviz/CURRENT/graphviz-working.tar.gz
Then, the usual:
./configure
make
make install
from rails-erd.
I can confirm @rsutaria's method: Building from sources is the only one that works for me on macOS Sierra 10.12.4.
from rails-erd.
@rsutaria's solution is the only one that worked for me on macOS Sierra 10.12.6.
from rails-erd.
Running High Sierra 10.13.5
The source file has moved
This worked for me.
curl "https://graphviz.gitlab.io/pub/graphviz/stable/SOURCES/graphviz.tar.gz" | tar xz
cd graphviz-2.40.1
./configure
make
make install
from rails-erd.
Related Issues (20)
- Error when trying to run on Ubuntu HOT 3
- Polluting global scope with rake task helper method
- rails-red conflicts with discard gem HOT 1
- Add instructions for how to use rails-erd in a gem
- Bug with --only and -only_recursion_depth
- Rails 7 deprecation warnings HOT 1
- FrozenError: can't modify frozen String: "boolean" HOT 4
- Clarify how to customise output directory
- Warnings on Rails internal tables that have not been created HOT 2
- Spec failure on Graphviz fonts when running locally
- Disabling auto-generate on db:migrate HOT 2
- Changing output file path. HOT 3
- Use translations for models and attributes
- rails db:migrate
- compond foreign key to_sym on Array during rake db:migrate HOT 1
- Assertion failed: (filename && *filename), function try_dlopen, file ltdl.c, line 1204. HOT 1
- Can I customize the data instead of auto-generating it from my ActiveRecord relations?
- Enhancment: Mermaid style uses classDiagram, not erDiagram
- NoMethodError: undefined method `name' for nil:NilClass (seems to be related to PaperTrail)
- Support Eclipse Layout Kernel
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rails-erd.