Comments (17)
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.
Same behavior.
from combustion.
Thanks for the quick reply by the way. :)
from combustion.
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.
@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.
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.
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.
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.
@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.
Sure. I've updated it.
from combustion.
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.
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.
@pat oh snap. Check out my pull request LandonSchropp/issue_engine#1 and let me know what you think.
from combustion.
Looks good to me Phil 👍
from combustion.
I'm closing this as I don't believe it is a problem in Combustion anymore :)
from combustion.
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.
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)
- Typo in README.md HOT 1
- Error Sprockets::Railtie::ManifestNeededError HOT 7
- Loosen (or bump) dependency on rubocop? HOT 2
- `no implicit conversion of nil into String (TypeError)` with 1.2.0 HOT 4
- deprecation on rails edge involving db configuration to_h HOT 3
- Drop `git` in gemspec? HOT 1
- Don't know how to fix rake tasks in engine HOT 3
- uninitialized constant.. HOT 2
- Support for webpacker + capybara ? HOT 7
- Getting a NameError on `ActiveRecord` for project not initialising activerecord HOT 4
- Rails edge failure involving sprockets-rails HOT 1
- Rails 7.0.0.alpha1 deprecation warning involving `connection_handlers` HOT 4
- legacy_connection_handling= no longer supported in Rails main/edge HOT 3
- combustion 1.3.6 fails to require sprockets for Rails 6.1.1+ HOT 1
- Open up for extensibility HOT 4
- ActiveRecord::Base.clear_active_connections! is deprecated in current edge Rails 7.1 HOT 2
- deprecation warning in Rails 7.1 on clear_active_connections! HOT 3
- deprecation warning on Rails 7.1 on config.active_support.cache_format_version = 6.1 HOT 4
- NameError: uninitialized constant Rails HOT 3
- Rails main branch deprecation on cache_format_version HOT 4
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 combustion.