Giter Site home page Giter Site logo

Comments (12)

michaeldv avatar michaeldv commented on August 18, 2024

Please install the latest v1.0.1

HTH
Michael

from awesome_print.

grimen avatar grimen commented on August 18, 2024

Will do that, thanks Michael!

from awesome_print.

grimen avatar grimen commented on August 18, 2024

Hmm...didnt' resolve it in fact. Has it been a known issue before?

/Users/grimen/.rvm/gems/ruby-1.9.3-p0/gems/awesome_print-1.0.1/lib/awesome_print/ext/action_view.rb:18:in `<top (required)>': uninitialized constant ActionView::Base (NameError)
    from /Users/grimen/.rvm/gems/ruby-1.9.3-p0/gems/awesome_print-1.0.1/lib/awesome_print.rb:26:in `<top (required)>'
    from /Users/grimen/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.rc/lib/bundler/runtime.rb:68:in `require'
    from /Users/grimen/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.rc/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    from /Users/grimen/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.rc/lib/bundler/runtime.rb:66:in `each'
    from /Users/grimen/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.rc/lib/bundler/runtime.rb:66:in `block in require'
    from /Users/grimen/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.rc/lib/bundler/runtime.rb:55:in `each'
    from /Users/grimen/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.rc/lib/bundler/runtime.rb:55:in `require'
    from /Users/grimen/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.rc/lib/bundler.rb:128:in `require'
    from /Users/grimen/Dropbox/Development/projects/merchii/merchii-api/config/environment.rb:16:in `<top (required)>'
    from /Users/grimen/Dropbox/Development/projects/merchii/merchii-api/app.rb:1:in `require'
    from /Users/grimen/Dropbox/Development/projects/merchii/merchii-api/app.rb:1:in `<top (required)>'
    from /Users/grimen/Dropbox/Development/projects/merchii/merchii-api/spec/spec_helper.rb:13:in `require'
    from /Users/grimen/Dropbox/Development/projects/merchii/merchii-api/spec/spec_helper.rb:13:in `<top (required)>'
    from /Users/grimen/Dropbox/Development/projects/merchii/merchii-api/spec/api_spec.rb:1:in `require'
    from /Users/grimen/Dropbox/Development/projects/merchii/merchii-api/spec/api_spec.rb:1:in `<top (required)>'
    from /Users/grimen/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:10:in `require'
    from /Users/grimen/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:10:in `block (2 levels) in <main>'
    from /Users/grimen/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:9:in `each'
    from /Users/grimen/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:9:in `block in <main>'
    from /Users/grimen/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:4:in `select'
    from /Users/grimen/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:4:in `<main>'

from awesome_print.

michaeldv avatar michaeldv commented on August 18, 2024

How do you load awesome_print gem? The rake command and Rails version would also be helpful. There's a check whether ActionView is defined in https://github.com/michaeldv/awesome_print/blob/master/lib/awesome_print.rb, so it must be something rather unusual.

Michael

from awesome_print.

michaeldv avatar michaeldv commented on August 18, 2024

...and no, this is is a new issue, nobody has reported it before.

from awesome_print.

grimen avatar grimen commented on August 18, 2024

I'm using it within a Sinatra-app. I noticed it started to appear when I temporarily injected Devise for experimental things - which depends on Rails. But either way it should not break like this, must be something funky with the dependency loading within the gem parts that depend on ActionView. Haven't checked the internals of 'awesome_print' yet so cannot say much about it. I removed ap as dependency now as I'm in middle of stuff (no time to dig deeper), but I think this one should be kept an eye on as a gem should not clash like this with optional dependencies.

from awesome_print.

michaeldv avatar michaeldv commented on August 18, 2024

I think changing:

require File.dirname(FILE) + "/awesome_print/ext/action_view" if defined?(ActionView)

to

require File.dirname(FILE) + "/awesome_print/ext/action_view" if defined?(ActionView::Base)

in awesome_print/lib/awesome_print.rb should fix your issue. Please confirm when you have a chance so I could add it in the next release.

Thanks,
Michael

from awesome_print.

esetnik avatar esetnik commented on August 18, 2024

I am having a similar issue. I tried the fix above but it has not resolved the issue. After adding the required code to my ~/.irbrc I get:

Loading development environment (Rails 3.1.0)
cannot load such file -- awesome_print
1.9.3p0 :001 >

from awesome_print.

michaeldv avatar michaeldv commented on August 18, 2024

Is awesome_print gem part of :development group in your Gemfile and Gemfile.lock?

from awesome_print.

esetnik avatar esetnik commented on August 18, 2024

No, I was installing the gem directly with rvmsudo gem install awesome_print. When I added it to my gemfile I get the error

Errno::EACCES: Permission denied - /Users/*****/.rvm/gems/ruby-1.9.3-p0/gems/awesome_print-1.0.1/CHANGELOG
An error occured while installing awesome_print (1.0.1), and Bundler cannot continue.
Make sure that gem install awesome_print -v '1.0.1' succeeds before bundling.

from awesome_print.

michaeldv avatar michaeldv commented on August 18, 2024

That's why it doesn't get loaded. Please make sure the gem is installed properly.

from awesome_print.

esetnik avatar esetnik commented on August 18, 2024

How do I get the gem to install properly? I don't have a permission
issue with any other gems.

Sent from my iPhone

On Dec 8, 2011, at 9:00 PM, Michael Dvorkin
[email protected]
wrote:

That's why it doesn't get loaded. Please make sure the gem is installed properly.


Reply to this email directly or view it on GitHub:
https://github.com/michaeldv/awesome_print/issues/62#issuecomment-3074466

from awesome_print.

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.