Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix bundler and rake #5

Merged
merged 3 commits into from

2 participants

@apohllo

I had some problems running the Rake tasks. I suppose it was due to the require 'bundler' entry in the Rakefile. I made some require reorderings, added a dependency on rake-compiler task and also defined cleaning and compilation as a dependencies for spec. Now everything seems to work fine.

@igrigorik
Owner

Weird, works just fine on this end, but your changes work as well.. scratches head

@igrigorik igrigorik merged commit 91ec1ab into from
@apohllo

I had problems like this:

``rspec spec/native_spec.rb
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/runtime.rb:31:in
block in setup': You have already activated rspec-core 2.8.0, but your Gemfile requires rspec-core 2.5.1. Using bundle exec may solve this. (Gem::LoadError)
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/runtime.rb:17:in setup'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler.rb:110:in
setup'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/setup.rb:7:in <top (required)>'
from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in
require'


```ruby spec/native_spec.rb
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- helper (LoadError)
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from spec/native_spec.rb:1:in `<main>'````

```rake spec
/usr/local/rvm/rubies/ruby-1.9.2-p290/bin/ruby -S rspec ./spec/native_spec.rb ./spec/counting_redis_spec.rb ./spec/redis_spec.rb
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/runtime.rb:31:in `block in setup': You have already activated rspec-core 2.8.0, but your Gemfile requires rspec-core 2.5.1. Using bundle exec may solve this. (Gem::LoadError)
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/runtime.rb:17:in `setup'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler.rb:110:in `setup'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/setup.rb:7:in `<top (required)>'
    from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
    from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'````

```bundle exec ruby spec/native_spec.rb 
spec/native_spec.rb:1:in `require': no such file to load -- helper (LoadError)
    from spec/native_spec.rb:1:in `<main>'

``bundle exec ruby spec/native_spec.rb
/home/fox/src/nlp/wsd/bloomfilter-rb/lib/bloomfilter-rb.rb:4:in
require': no such file to load -- cbloomfilter (LoadError)
from /home/fox/src/nlp/wsd/bloomfilter-rb/lib/bloomfilter-rb.rb:4:in <top (required)>'
from spec/native_spec.rb:2:in
require'
from spec/native_spec.rb:2:in `

'


but now when I call ```bundle exec rake spec``` everything works fine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 3 deletions.
  1. +2 −0  .gitignore
  2. +4 −2 Rakefile
  3. +2 −1  bloomfilter-rb.gemspec
View
2  .gitignore
@@ -2,3 +2,5 @@
*.bundle
*.swp
ext/Makefile
+lib/cbloomfilter.so
+tmp
View
6 Rakefile
@@ -1,9 +1,11 @@
+require 'bundler/gem_tasks'
require 'rake'
require 'rspec'
require 'rspec/core/rake_task'
require 'rake/extensiontask'
-require 'bundler'
Bundler::GemHelper.install_tasks
+Rake::ExtensionTask.new('cbloomfilter')
RSpec::Core::RakeTask.new(:spec)
-Rake::ExtensionTask.new('cbloomfilter')
+Rake::Task[:spec].prerequisites << :clean
+Rake::Task[:spec].prerequisites << :compile
View
3  bloomfilter-rb.gemspec
@@ -16,6 +16,7 @@ Gem::Specification.new do |s|
s.add_dependency "redis"
s.add_development_dependency "rspec"
s.add_development_dependency "rake"
+ s.add_development_dependency "rake-compiler"
s.extensions = ["ext/cbloomfilter/extconf.rb"]
@@ -23,4 +24,4 @@ Gem::Specification.new do |s|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
-end
+end
Something went wrong with that request. Please try again.