Closed cbarraford closed 9 years ago
It looks like this may not be a treat specific problem. If i install a random gem,
gem install thor
Rspec can't load that one either.
[cbarraford@chad-mbp svo]$ rspec spec/proof_spec.rb
fatal: Not a git repository (or any of the parent directories): .git
["/Users/cbarraford/.rvm/gems/ruby-2.1.3@svo-dev",
"/Users/cbarraford/.rvm/gems/ruby-2.1.3@global"]
/Users/cbarraford/workshop/svo/spec/proof_spec.rb:6:in `require': cannot load such file -- thor (LoadError)
from /Users/cbarraford/workshop/svo/spec/proof_spec.rb:6:in `<top (required)>'
from /Users/cbarraford/.rvm/gems/ruby-2.1.3@svo-dev/gems/rspec-core-3.1.5/lib/rspec/core/configuration.rb:1105:in `load'
from /Users/cbarraford/.rvm/gems/ruby-2.1.3@svo-dev/gems/rspec-core-3.1.5/lib/rspec/core/configuration.rb:1105:in `block in load_spec_files'
from /Users/cbarraford/.rvm/gems/ruby-2.1.3@svo-dev/gems/rspec-core-3.1.5/lib/rspec/core/configuration.rb:1105:in `each'
from /Users/cbarraford/.rvm/gems/ruby-2.1.3@svo-dev/gems/rspec-core-3.1.5/lib/rspec/core/configuration.rb:1105:in `load_spec_files'
from /Users/cbarraford/.rvm/gems/ruby-2.1.3@svo-dev/gems/rspec-core-3.1.5/lib/rspec/core/runner.rb:96:in `setup'
from /Users/cbarraford/.rvm/gems/ruby-2.1.3@svo-dev/gems/rspec-core-3.1.5/lib/rspec/core/runner.rb:84:in `run'
from /Users/cbarraford/.rvm/gems/ruby-2.1.3@svo-dev/gems/rspec-core-3.1.5/lib/rspec/core/runner.rb:69:in `run'
from /Users/cbarraford/.rvm/gems/ruby-2.1.3@svo-dev/gems/rspec-core-3.1.5/lib/rspec/core/runner.rb:37:in `invoke'
from /Users/cbarraford/.rvm/gems/ruby-2.1.3@svo-dev/gems/rspec-core-3.1.5/exe/rspec:4:in `<top (required)>'
from /Users/cbarraford/.rvm/gems/ruby-2.1.3@svo-dev/bin/rspec:23:in `load'
from /Users/cbarraford/.rvm/gems/ruby-2.1.3@svo-dev/bin/rspec:23:in `<main>'
from /Users/cbarraford/.rvm/gems/ruby-2.1.3@svo-dev/bin/ruby_executable_hooks:15:in `eval'
from /Users/cbarraford/.rvm/gems/ruby-2.1.3@svo-dev/bin/ruby_executable_hooks:15:in `<main>'
But if anyone has any ideas on what I can try to fix it, it would be appreciated.
Ah ha! The reason why rspec wasn't able to load some gems is because the gem (ie engtagger
) wasn't listed in the gemfile. The treat
gem was listed, but because engtagger
is a dependency of treat
and its not listed as dependency in the gemspec file, rspec didn't know that it was going to need it.
Is there a reason why the treat gemspec doesn't list all of the dependencies??
The reason why we don't list all dependencies is because many of them are C extensions and will fail to install on certain platforms. Another reason is to keep from installing 40 dependencies when a user may only use one or two of them. Therefore, the preferred way is to add these gems to your gemfile.
I'm seeing a weird issue with treat and rspec.
I have treat installed and ran the ruby command to install the jar files and other dependencies. That succeeded without an issue. I am using the latest stable version of rvm. When i go into
irb
i can loadengtagger
no problem.And i can load it no issue when I run a ruby script.
But when i load
engtagger
(and other treat dependency gems) inside an rspec file, i get a load error.Here is my gem environment info
Has anyone seen this? I'm running the latest version rspec, treat, and ruby.