Code Monkey home page Code Monkey logo

Comments (17)

pat avatar pat commented on August 21, 2024

First thought: what happens if you move rspec-rails in your Gemfile outside of the test group, so it's always loaded? The Gemfile only has an impact as you're developing anyway, so the test grouping is unnecessary.

from combustion.

LandonSchropp avatar LandonSchropp commented on August 21, 2024

Same behavior.

from combustion.

LandonSchropp avatar LandonSchropp commented on August 21, 2024

Thanks for the quick reply by the way. :)

from combustion.

pat avatar pat commented on August 21, 2024

Hmm... what happens if you shift rspec-rails (and maybe all gems in your Gemfile) below the gemspec line? I'm guessing rspec-rails needs Rails to be already loaded, perhaps?

from combustion.

robyurkowski avatar robyurkowski commented on August 21, 2024

@pat If this fails, @parndt and I ran into a similar issue whereby rspec-rails would complain if it was required by the Gemfile. Our solution was to simply add :require => false to it.

Not sure that'll help, but it might be a step forward.

from combustion.

LandonSchropp avatar LandonSchropp commented on August 21, 2024

Hey @pat, sorry I missed your reply earlier. I'll give that a try. If it doesn't work, I'll try @robyurkowski's solution. Thanks again for the help!

from combustion.

LandonSchropp avatar LandonSchropp commented on August 21, 2024

Moving the gemspec line above the other gems and running bundle exec rspec produced a different error:

/Users/landonschropp/Dropbox/Development/current/issue_engine/lib/issue_engine/engine.rb:2:in `<module:IssueEngine>': uninitialized constant Rails (NameError)
    from /Users/landonschropp/Dropbox/Development/current/issue_engine/lib/issue_engine/engine.rb:1:in `<top (required)>'
    from /Users/landonschropp/Dropbox/Development/current/issue_engine/lib/issue_engine.rb:1:in `require'
    from /Users/landonschropp/Dropbox/Development/current/issue_engine/lib/issue_engine.rb:1:in `<top (required)>'
    from /Users/landonschropp/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `require'
    from /Users/landonschropp/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    from /Users/landonschropp/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `each'
    from /Users/landonschropp/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `block in require'
    from /Users/landonschropp/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `each'
    from /Users/landonschropp/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `require'
    from /Users/landonschropp/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler.rb:128:in `require'
    from /Users/landonschropp/Dropbox/Development/current/issue_engine/spec/spec_helper.rb:4:in `<top (required)>'
    from /Users/landonschropp/Dropbox/Development/current/issue_engine/spec/controllers/static_controller_spec.rb:1:in `require'
    from /Users/landonschropp/Dropbox/Development/current/issue_engine/spec/controllers/static_controller_spec.rb:1:in `<top (required)>'
    from /Users/landonschropp/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `load'
    from /Users/landonschropp/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `block in load_spec_files'
    from /Users/landonschropp/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `each'
    from /Users/landonschropp/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `load_spec_files'
    from /Users/landonschropp/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/rspec-core-2.12.2/lib/rspec/core/command_line.rb:22:in `run'
    from /Users/landonschropp/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/rspec-core-2.12.2/lib/rspec/core/runner.rb:80:in `run'
    from /Users/landonschropp/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/rspec-core-2.12.2/lib/rspec/core/runner.rb:17:in `block in autorun'

I tried adding the :require => false line to the Gemfile but it didn't have any effect.

from combustion.

pat avatar pat commented on August 21, 2024

Landon, could you update your repo to reflect these changes? Once you've done that I'll clone it and see if I can reproduce the problem locally, and then figure out how to fix it.
https://github.com/LandonSchropp/issue_engine

from combustion.

parndt avatar parndt commented on August 21, 2024

@pat once you have had an opportunity to, let me know if you can't figure it out and I'll take a look too :-)

from combustion.

LandonSchropp avatar LandonSchropp commented on August 21, 2024

Sure. I've updated it.

from combustion.

pat avatar pat commented on August 21, 2024

Landon: thank you. Phil: I won't have any time in at least the next 24 hours - so feel free to jump in and investigate if you can :)

from combustion.

pat avatar pat commented on August 21, 2024

I've had a go at fixing this problem, and I think it comes down to this: if you have a necessary dependency on Rails in your library, then you should require rails when your library is loaded. Same applies to any other necessary dependencies. It's what I've done in Dobro, the library I built Combustion to test:
https://github.com/hypertiny/dobro/blob/master/lib/dobro.rb#L1

This means you'll need to have require 'rails' at the top of lib/issue_engine.rb.

If Rails wasn't critical, then I would only require the engine file if Rails is already loaded - here's an example from Thinking Sphinx:
https://github.com/pat/thinking-sphinx/blob/master/lib/thinking_sphinx.rb#L58

Once I added that require rails line in, then running rspec fails for a different reason - but we've just patched that issue in Combustion, and will be pushing a new release out shortly.

from combustion.

parndt avatar parndt commented on August 21, 2024

@pat oh snap. Check out my pull request LandonSchropp/issue_engine#1 and let me know what you think.

from combustion.

pat avatar pat commented on August 21, 2024

Looks good to me Phil 👍

from combustion.

parndt avatar parndt commented on August 21, 2024

I'm closing this as I don't believe it is a problem in Combustion anymore :)

from combustion.

LandonSchropp avatar LandonSchropp commented on August 21, 2024

Thanks for figuring out where my problem was @path. @parndt, you pull request is also extremely helpful. Thanks for taking the time to help guys.

Two questions:

  • Any timeline on when that patch will be released? Can you reference it?
  • Is there anything I can do to help with the readme documentation so other people don't experience the problems I did?

Thanks again!

from combustion.

pat avatar pat commented on August 21, 2024

Combustion 0.4.0 is out now, so give that a spin and see how you go :)

On 17/03/2013, at 5:18 PM, Landon Schropp wrote:

There's a lot of great things in your pull request @parndt. Thanks for taking the time to submit it!

Two questions:

• Any timeline on when that patch will be released? Can you reference it?
• Is there anything I can do to help update the readme documentation so other people don't experience some of the problems I did?
Thanks again!


Reply to this email directly or view it on GitHub.

from combustion.

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.