1.9.2-dev gem install error "can't find executable rake"

1,905 views
Skip to first unread message

Ilkka

unread,
Aug 2, 2010, 8:17:12 AM8/2/10
to RubyInstaller
Hi,

Somebody else mentioned this problem already in another thread (http://
groups.google.com/group/rubyinstaller/msg/2533a65eab995171) but as far
as I can tell there was no solution given there... The problem is
this: having installed 1.9.2, in Windows 7, either with "pik install"
or by getting it manually from rubyinstaller.org's experimental build,
"gem install spork" fails with this error (copypaste from manually
downloaded version):

-----------------------------
c:\>gem install spork
Building native extensions. This could take a while...
ERROR: Error installing spork:
ERROR: Failed to build gem native extension.

C:/ruby-1.9.2-rc1-i386-mingw32/bin/ruby.exe mkrf_conf.rb
Actually, there aren't any native extensions. I'm just dynamically
installing dependencies based off of your operating system

rake RUBYARCHDIR=C:/ruby-1.9.2-rc1-i386-mingw32/lib/ruby/gems/1.9.1/
gems/spork-0.8.4/lib RUBYLIBDIR=C:/ruby-1.9.2-rc1-i386-mingw32/lib/
ruby/gems/1.9.1/gems/spork-0.8.4/lib
C:/ruby-1.9.2-rc1-i386-mingw32/lib/ruby/site_ruby/1.9.1/rubygems.rb:
335:in `bin_path': can't find executable rake for rake-0.8.7
(Gem::Exception)
from <internal:gem_prelude>:282:in `method_missing'
from C:/ruby-1.9.2-rc1-i386-mingw32/bin/rake:19:in `<main>'


Gem files will remain installed in C:/ruby-1.9.2-rc1-i386-mingw32/lib/
ruby/gems/1.9.1/gems/spork-0.8.4 for inspection.
Results logged to C:/ruby-1.9.2-rc1-i386-mingw32/lib/ruby/gems/1.9.1/
gems/spork-0.8.4/ext/gem_make.out
-----------------------------

The output of install --debug -V is at http://gist.github.com/504548,
please excuse the windows terminal linewrap formatting horrors.

Any ideas why this is? I noticed one difference between rubyinstaller
1.9.1 and my 1.9.2 version is that there was no "rake" script and no
"rake.bat" in lib/ruby/gems/1.9.1/bin, but adding those there myself
(by suitably adapting from 1.9.1) didn't help.

Roger Pack

unread,
Aug 2, 2010, 10:33:43 AM8/2/10
to rubyin...@googlegroups.com
> 335:in `bin_path': can't find executable rake for rake-0.8.7

Did you try installing rake gem?
-r

Ilkka

unread,
Aug 2, 2010, 4:34:21 PM8/2/10
to RubyInstaller


On 2 elo, 17:33, Roger Pack <rogerdp...@gmail.com> wrote:
> > 335:in `bin_path': can't find executable rake for rake-0.8.7
>
> Did you try installing rake gem?

I probably should've mentioned that rake is installed :)

Luis Lavena

unread,
Aug 2, 2010, 4:41:39 PM8/2/10
to rubyin...@googlegroups.com

Ruby 1.9.2 includes Rake, but the problem is that the gem installation
process is not seeing it.

Spork uses mkrf (Make Rakefile) which hasn't been the best support
ever in RubyGems itself.

Can you include the following?

Output of "gem env"

Output of "gem install spork --debug -V"

We prefer the output of these things into a Gist/Pastie, so the lines
are not mangled by email clients

With that info I would be able to replicate the environment and try
again, as here, it works:

C:\Users\Luis>ruby -v
ruby 1.9.2dev (2010-07-02) [i386-mingw32]

C:\Users\Luis>gem install spork
Temporarily enhancing PATH to include DevKit...


Building native extensions. This could take a while...

Successfully installed spork-0.8.4
1 gem installed

But simply because I've installed Rake over bundled Ruby installation:

gem list -d rake

rake (0.8.7)
Author: Jim Weirich
Rubyforge: http://rubyforge.org/projects/rake
Homepage: http://rake.rubyforge.org
Installed at: C:/Users/Luis/.gem/ruby/x86-mingw32/1.9.1

Ruby based make-like utility.


--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

Ilkka

unread,
Aug 3, 2010, 8:29:26 AM8/3/10
to RubyInstaller
On 2 elo, 23:41, Luis Lavena <luislav...@gmail.com> wrote:
> On Mon, Aug 2, 2010 at 5:34 PM, Ilkka <ilkka.s.laukka...@gmail.com> wrote:
> Ruby 1.9.2 includes Rake, but the problem is that the gem installation
> process is not seeing it.

Yeah, I gathered that's the root cause here.

> Spork uses mkrf (Make Rakefile) which hasn't been the best support
> ever in RubyGems itself.
>
> Can you include the following?
>
> Output of "gem env"

http://gist.github.com/506276

> Output of "gem install spork --debug -V"

http://gist.github.com/504548

> We prefer the output of these things into a Gist/Pastie, so the lines
> are not mangled by email clients

I'm sorry about the formatting of that second gist, the mangling there
is due to the windows console and I really don't want to manually fix
all 200 lines of it... the mangled part seems (to me) to be just "file
already exists" messages due to this being the umpteenth time I tried
that installation. I did fix the bottom part, hope that helps.

> With that info I would be able to replicate the environment and try
> again, as here, it works:
>
> ...
>
> Successfully installed spork-0.8.4
> 1 gem installed
>
> But simply because I've installed Rake over bundled Ruby installation:

I tried to figure out how to force-install rake like that but couldn't
find any way other than just "gem install". Anyway, it didn't seem to
change anything.

Luis Lavena

unread,
Aug 3, 2010, 8:46:52 AM8/3/10
to rubyin...@googlegroups.com
On Tue, Aug 3, 2010 at 9:29 AM, Ilkka <ilkka.s....@gmail.com> wrote:
>
> I tried to figure out how to force-install rake like that but couldn't
> find any way other than just "gem install". Anyway, it didn't seem to
> change anything.
>

Well, seems is not the problem of having rake or not, but something in
your system that is not working properly (I've shown the success of
that gem installation).

Excluding for a second that Spork does something not good in the mkrf_conf:

http://github.com/timcharper/spork/blob/master/ext/mkrf_conf.rb

Did you install Ruby with administrative rights? (or as normal user?)
Just to discard that C:/ruby-1.9.2-rc1-i386-mingw32 is been blocked by
NTFS permissions.

Can you CD into
C:/ruby-1.9.2-rc1-i386-mingw32/lib/ruby/gems/1.9.1/gems/spork-0.8.4/ext

and execute:

ruby mkrf_conf.rb

And then:

rake --trace RUBYARCHDIR=C:/ruby-1.9.2-rc1-i386-mingw32/lib/ruby/gems/1.9.1/gems/spork-0.8.4/lib
RUBYLIBDIR=C:/ruby-1.9.2-rc1-i386-mingw32/lib/ruby/gems/1.9.1/gems/spork-0.8.4/lib

Please create a Gist of the output of both commands.

Also, include:

SET PATH

And info if you have or not the DevKit installed, as Spork depends on
win32-process which do not provide a gem for mingw32.

Since I previously had win32-process installed, that could be the
culprit of the issue you're having.

Thank you.

Ilkka

unread,
Aug 3, 2010, 3:45:08 PM8/3/10
to RubyInstaller
On 3 elo, 15:46, Luis Lavena <luislav...@gmail.com> wrote:
>
> Did you install Ruby with administrative rights? (or as normal user?)
> Just to discard that C:/ruby-1.9.2-rc1-i386-mingw32 is been blocked by
> NTFS permissions.

I just unpacked the .7z, but the account I use is a local
Administrator. I'm not really familiar with windows' security
quirks :)

> Can you CD into
> C:/ruby-1.9.2-rc1-i386-mingw32/lib/ruby/gems/1.9.1/gems/spork-0.8.4/ext
>
> and execute:
>
> ruby mkrf_conf.rb

http://gist.github.com/507008

> And then:
>
> rake --trace RUBYARCHDIR=C:/ruby-1.9.2-rc1-i386-mingw32/lib/ruby/gems/1.9.1/gems/spork-0.8.4/lib
> RUBYLIBDIR=C:/ruby-1.9.2-rc1-i386-mingw32/lib/ruby/gems/1.9.1/gems/spork-0.8.4/lib

http://gist.github.com/507012

> Also, include:
>
> SET PATH

http://gist.github.com/507025

> And info if you have or not the DevKit installed, as Spork depends on
> win32-process which do not provide a gem for mingw32.

Devkit is installed.

Also I think I forgot to mention that spork installed fine into 1.9.1.

rogerdpack

unread,
Aug 5, 2010, 10:19:22 PM8/5/10
to RubyInstaller
I see it too with 1.9.2 (and trunk) on windows 7 but not on XP.

D:\installs\ruby-1.9.2-rc1-i386-mingw32\ruby-1.9.2-rc1-i386-mingw32\bin
\ruby-1.9.2-rc1-i386-mingw32\ruby-1.9.2-rc1-i386-mingw32\bin>rake -T
D:/installs/ruby-1.9.2-rc1-i386-mingw32/ruby-1.9.2-rc1-i386-mingw32/
bin/ruby-1.9.2-rc1-i386-mingw32/ruby-1.9.2-rc1-i386-mingw32/lib/ruby/
site_ruby/1.9.1/rubygems.rb:326:in `bin_path': can't find executable
rake for rake-0.8.7 (Gem::Exception)
from <internal:gem_prelude>:282:in `method_missing'
from D:/installs/ruby-1.9.2-rc1-i386-mingw32/ruby-1.9.2-rc1-
i386-mingw32/bin/ruby-1.9.2-rc1-i386-mingw32/ruby-1.9.2-rc1-i386-
mingw32/bin/rake:19:in `<main>'

It seems to do that both from a console window opened as normal user
and one opened as administrator. Seems to also work fine from linux.

Guess it's back to 1.9.1 for me :)

-r

Sickboy

unread,
Aug 6, 2010, 3:18:21 AM8/6/10
to RubyInstaller
Just copy your 1.9.1 bin/rake to 1.9.2 bin/rake - seems something
goes wrong with generating the rake.bat or rake shell script on gem
install.

rogerdpack

unread,
Aug 7, 2010, 10:41:16 AM8/7/10
to RubyInstaller
> Just copy your 1.9.1 bin/rake  to 1.9.2 bin/rake - seems something
> goes wrong with generating the rake.bat or rake shell script on gem
> install.

Odd, mine seem the same.
How do yours differ, do you mind my asking?
-r

C:\dev\PIG-2.3>copy c:\ruby19\bin\rake C:\installs\ruby_1_9_2_installed
\bin
Overwrite C:\installs\ruby_1_9_2_installed\bin\rake? (Yes/No/All): y
1 file(s) copied.

C:\dev\PIG-2.3>ruby -v
ruby 1.9.2dev (2010-08-05 revision 28875) [i386-mingw32]

C:\dev\PIG-2.3>rake -T
C:/installs/ruby_1_9_2_installed/lib/ruby/1.9.1/rubygems.rb:340:in
`bin_path': can't find executable rake for rake-0.8.7 (Gem::Exception)
from C:/installs/ruby_1_9_2_installed/bin/rake:19:in `<main>'

Boško Ivanišević

unread,
Aug 10, 2010, 5:59:27 AM8/10/10
to rubyin...@googlegroups.com
Has anyone found solution for this? On Windows 7 x64 this error also occurs (http://gist.github.com/517015).
 
--
Regards,
Boško Ivanišević

Roger Pack

unread,
Aug 10, 2010, 1:59:18 PM8/10/10
to rubyin...@googlegroups.com
> Has anyone found solution for this? On Windows 7 x64 this error also occurs
> (http://gist.github.com/517015).

Reverting to 1.9.2 preview3 and it seems to work ok there.
-r

rogerdpack

unread,
Aug 11, 2010, 4:58:29 PM8/11/10
to RubyInstaller
> Reverting to 1.9.2 preview3 and it seems to work ok there.

I take that back. Appears to be same problem with 1.9.2 preview3 as
well.

Only fix I've found thus far is to 1) never re-install the rake gem
or
2) delete any rake.gemspec file that comes along with your ruby distro
[1]

-r

[1] http://www.ruby-forum.com/topic/214757#932314

Boško Ivanišević

unread,
Aug 12, 2010, 5:30:02 AM8/12/10
to rubyin...@googlegroups.com
On Wed, Aug 11, 2010 at 10:58 PM, rogerdpack <rogerp...@gmail.com> wrote:
> Reverting to 1.9.2 preview3 and it seems to work ok there.

I take that back.  Appears to be same problem with 1.9.2 preview3 as
well.

Only fix I've found thus far is to 1) never re-install the rake gem
or
I'm not sure this will help.
 
2) delete any rake.gemspec file that comes along with your ruby distro
[1]

-r

[1] http://www.ruby-forum.com/topic/214757#932314


Since I cannot add comment to the issue in Ruby Redmine I'll post here what I've found so far. Problem is that during installation in rbinstall.rb line 516 default .gemspec files are created for rake, rdoc and minitest. These files are saved by default in lib/ruby/gems/1.9.1/specifications. If everything is left by default other gems will be installed there too (that's why this problem can occur on Linux too). Since these specifications do not contain default_executable and executables sections invoking them results in error. If rvm is used on Linux error will not occur because gems will be installed in different folder and load path is set to that folder and rake.gemspec and rake-0.8.7.gemspec will not both be loaded. Later one has correct sections for default_executable and executables thus everything will work correctly.

Unfortunately in our RubyInstaller both of these files will be in the same directory and that's the reason why reinstalling rake doesn't help unless rake.gemspec is deleted since this specification is loaded after rake-0.8.7.gemspec and overrides it. I'm not sure what would be the best approach to fix this problem. Either not to bundle rake with Ruby or to create correct .gemspec file. We can also set different installation directory too  like rvm does.

--
Regards,
Boško Ivanišević

Boško Ivanišević

unread,
Aug 12, 2010, 5:32:22 AM8/12/10
to rubyin...@googlegroups.com
2010/8/12 Boško Ivanišević <bosko.iv...@gmail.com>

Forgot to write... Quick fix, as is already mentioned, is to delete rake.gemspec and reinstall rake gem.

--
Regards,
Boško Ivanišević

Luis Lavena

unread,
Aug 12, 2010, 11:06:05 AM8/12/10
to rubyin...@googlegroups.com
2010/8/12 Boško Ivanišević <bosko.iv...@gmail.com>:

>
> Since I cannot add comment to the issue in Ruby Redmine I'll post here what
> I've found so far. Problem is that during installation in rbinstall.rb line
> 516 default .gemspec files are created for rake, rdoc and minitest. These
> files are saved by default in lib/ruby/gems/1.9.1/specifications. If
> everything is left by default other gems will be installed there too (that's
> why this problem can occur on Linux too). Since these specifications do not
> contain default_executable and executables sections invoking them results in
> error. If rvm is used on Linux error will not occur because gems will be
> installed in different folder and load path is set to that folder and
> rake.gemspec and rake-0.8.7.gemspec will not both be loaded. Later one has
> correct sections for default_executable and executables thus everything will
> work correctly.
> Unfortunately in our RubyInstaller both of these files will be in the same
> directory and that's the reason why reinstalling rake doesn't help unless
> rake.gemspec is deleted since this specification is loaded after
> rake-0.8.7.gemspec and overrides it. I'm not sure what would be the best
> approach to fix this problem. Either not to bundle rake with Ruby or to
> create correct .gemspec file. We can also set different installation
> directory too  like rvm does.

Thank you Bosko, putting this into the ticket in Redmine (you need an
account, but I got one).

Regards,

Jon

unread,
Aug 12, 2010, 2:55:35 PM8/12/10
to rubyin...@googlegroups.com
> Unfortunately in our RubyInstaller both of these files will be in the same
> directory and that's the reason why reinstalling rake doesn't help unless
> rake.gemspec is deleted since this specification is loaded after
> rake-0.8.7.gemspec and overrides it. I'm not sure what would be the best
> approach to fix this problem. Either not to bundle rake with Ruby or to
> create correct .gemspec file. We can also set different installation
> directory too like rvm does.

Would someone check using our 1.8.7p299 plus our new DevKit whether you see the following which may or may not be related? I have pik 0.2.8 installed and executed "pik sw 187".

gem install rdiscount --platform=ruby
ruby -rubygems -rrdiscount -e "puts RDiscount.new('**hello**').to_html"
gem uninstall rdiscount

gem install rdiscount --platform=ruby
ruby -rubygems -rrdiscount -e "puts RDiscount.new('**hello**').to_html"

I get a "ruby: no such file to load -- rdiscount (LoadError)" but when I try the following in irb, things work:

irb>require 'rubygems'
irb>require 'rdiscount'
irb>puts RDiscount.new('**hello**').to_html

Luis Lavena

unread,
Aug 12, 2010, 2:57:37 PM8/12/10
to rubyin...@googlegroups.com
On Thu, Aug 12, 2010 at 3:55 PM, Jon <jon.f...@gmail.com> wrote:
>
> Would someone check using our 1.8.7p299 plus our new DevKit whether you see the following which may or may not be related?  I have pik 0.2.8 installed and executed "pik sw 187".
>
> gem install rdiscount --platform=ruby
> ruby -rubygems -rrdiscount -e "puts RDiscount.new('**hello**').to_html"
> gem uninstall rdiscount
>
> gem install rdiscount --platform=ruby
> ruby -rubygems -rrdiscount -e "puts RDiscount.new('**hello**').to_html"
>
> I get a "ruby: no such file to load -- rdiscount (LoadError)" but when I try the following in irb, things work:
>

Command line require in Ruby 1.8 is the C version, so you need to:

ruby -rubygems -e "require 'rdiscount; ..."

For RubyGems own custom require is used.

AFAIK. 1.9 do not suffer from this.

Jon

unread,
Aug 12, 2010, 3:03:39 PM8/12/10
to rubyin...@googlegroups.com
> > gem install rdiscount --platform=ruby
> > ruby -rubygems -rrdiscount -e "puts RDiscount.new('**hello**').to_html"
> > gem uninstall rdiscount
> >
> > gem install rdiscount --platform=ruby
> > ruby -rubygems -rrdiscount -e "puts RDiscount.new('**hello**').to_html"
> >
> > I get a "ruby: no such file to load -- rdiscount (LoadError)" but when I try the following in irb, things work:
> >
>
> Command line require in Ruby 1.8 is the C version, so you need to:
>
> ruby -rubygems -e "require 'rdiscount; ..."
>
> For RubyGems own custom require is used.
>
> AFAIK. 1.9 do not suffer from this.

wow, you're right...crap that's _really_ subtle :(

r2d2rogers

unread,
Sep 30, 2010, 3:24:55 PM9/30/10
to RubyInstaller
This is what worked for me: http://gist.github.com/519744

Running gem install rake causes the issue. Removing the rake.gemspec
file fixes the issue, details in the link.

-Rob
> The output of install --debug -V is athttp://gist.github.com/504548,

Luis Lavena

unread,
Sep 30, 2010, 3:26:28 PM9/30/10
to rubyin...@googlegroups.com
On Thu, Sep 30, 2010 at 4:24 PM, r2d2rogers <r2d2r...@gmail.com> wrote:
> This is what worked for me: http://gist.github.com/519744
>
> Running gem install rake causes the issue.  Removing the rake.gemspec
> file fixes the issue, details in the link.
>

For the record that is going to be fixed in future updates of Ruby, a
patch has been sent an applied.

Reply all
Reply to author
Forward
0 new messages