Coder Social home page Coder Social logo

Comments (6)

kaleemullah avatar kaleemullah commented on May 18, 2024

same issue

from rails-erd.

dwwoelfel avatar dwwoelfel commented on May 18, 2024

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.

nicolasgarnil avatar nicolasgarnil commented on May 18, 2024

I'm having the same problem.

from rails-erd.

rolftimmermans avatar rolftimmermans commented on May 18, 2024

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.

Adithya-copart avatar Adithya-copart commented on May 18, 2024

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.

ADTC avatar ADTC commented on May 18, 2024

Try bundle exec erd as this will directly execute it instead of running it as a Rails Task.

from rails-erd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.