grep calls in Rakefile won't work on Windows #1047

djberg96 opened this Issue Feb 19, 2011 · 3 comments

3 participants


As the title says, you've got grep system calls being made in the Rakefile, which blows up the spec:deps task on Windows. They're being used to detect the presence of certain rubygems, which isn't necessary at all because rubygems provides an interface for this. I've pasted the patch below:

diff --git a/Rakefile b/Rakefile
index 6f9e3c4..4b71493 100644
--- a/Rakefile
+++ b/Rakefile
@@ -35,7 +35,9 @@ begin

       desc "Install CI dependencies"
       task :deps do
-        sh "gem list ci_reporter | (grep 'ci_reporter' 1> /dev/null) || gem install ci_reporter --n
+        unless Gem.available?("ci_reporter")
+          sh "gem gem install ci_reporter --no-ri --no-rdoc"
+        end
       task :deps => "spec:deps"
@@ -116,11 +118,14 @@ rescue LoadError
   namespace :spec do
     desc "Ensure spec dependencies are installed"
     task :deps do
-      sh "gem list ronn | (grep 'ronn' 1> /dev/null) || gem install ronn --no-ri --no-rdoc"
-      sh "gem list rspec | (grep 'rspec (2.0' 1> /dev/null) || gem install rspec --no-ri --no-rdoc"
+      unless Gem.available?('ronn')
+        sh "gem install ronn --no-rdoc --no-ri"
+      end
+      unless Gem.available?('rspec', "~> 2.0")
+        sh "gem install rspec --no-rdoc --no-ri"
+      end

 namespace :man do

Doesn't Cygwin et all provide grep though? I'm sorry haven't used Ruby on Windows but I'd think that grep would be provided, at least Cygwin does, don't know about others.


Also Gem.available? is deprecated so even if we do opt for this we'll need to take care of different RG versions capability.

Bundler member

Fixed in 1.2+

@ixti ixti closed this Jul 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment