Comments (6)
same issue
from rails-erd.
I solved this by adding the following line to my Rakefile:
require '/usr/lib/ruby/gems/1.8/gems/rails-erd-0.4.5/lib/rails_erd/tasks.rake'
I'm sure there's a better way, but this works.
from rails-erd.
I'm having the same problem.
from rails-erd.
The rake task is automatically registered in Rails projects. If you don't use Rails directly, you can use Rails ERD by calling the API. Here's an example:
require "rails_erd/diagram/graphviz"
# Load your models here.
RailsERD::Diagram::Graphviz.create
A future version may supply an executable file so you no longer need Rake and/or Rails.
from rails-erd.
For others who encounter the NoMethodError: undefined method `application' for Rails:Module
,
I was able to monkey-patch the name method in domain class to return nil and got around this.
Used outside Rails with ActiveRecord 5.1.1
RailsERD::Diagram::Graphviz.create
NoMethodError: undefined method `application' for Rails:Module
from /Users/adpentela/.rvm/gems/ruby-2.4.0/gems/rails-erd-1.5.2/lib/rails_erd/domain.rb:52:in `name'
from /Users/adpentela/.rvm/gems/ruby-2.4.0/gems/rails-erd-1.5.2/lib/rails_erd/diagram/graphviz.rb:179:in `block in <class:Graphviz>'
from /Users/adpentela/.rvm/gems/ruby-2.4.0/gems/rails-erd-1.5.2/lib/rails_erd/diagram.rb:126:in `instance_eval'
from /Users/adpentela/.rvm/gems/ruby-2.4.0/gems/rails-erd-1.5.2/lib/rails_erd/diagram.rb:126:in `generate'
from /Users/adpentela/.rvm/gems/ruby-2.4.0/gems/rails-erd-1.5.2/lib/rails_erd/diagram.rb:119:in `create'
from /Users/adpentela/.rvm/gems/ruby-2.4.0/gems/rails-erd-1.5.2/lib/rails_erd/diagram.rb:74:in `create'
from (irb):11
from /Users/adpentela/.rvm/rubies/ruby-2.4.0/bin/irb:11:in `<main>'
from rails-erd.
Try bundle exec erd
as this will directly execute it instead of running it as a Rails Task.
from rails-erd.
Related Issues (20)
- Tips to customise colours and rendering?
- 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)
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.