Project

General

Profile

Actions

Bug #2750

closed

build fails on win32/MinGW: "executable host ruby is required." even when --with-baseruby is used

Added by sirk390 (Christian Bodt) about 14 years ago. Updated almost 13 years ago.

Status:
Third Party's Issue
Assignee:
-
ruby -v:
ruby 1.9.2, 2010-02-15
[ruby-core:28188]

Description

=begin

  1. ACTION
    Using win32/MinGW:

    ./configure --with-baseruby=/c/Programs/ruby-1.9/bin/
    (...)
    make

  2. EXPECTED RESULT
    Build is successfull.

  3. ACTUAL RESULT
    Build fails with the error "executable host ruby is required. " even if "ruby.exe" is in the path or if the correct directory has been given using --with-baseruby

    make
    echo executable host ruby is required. use --with-baseruby option.; false -I. .
    /tool/compile_prelude.rb ./prelude.rb miniprelude.c
    executable host ruby is required. use --with-baseruby option.
    make: *** [miniprelude.c] Error 1

  4. ANALYSIS
    In configure.in line 22 we see RUBYOPT=- $BASERUBY -e 'p 42' 2>/dev/null" = 42
    But when running the command "RUBYOPT=- /c/Programs/ruby-1.9/bin/ruby.exe -e 'p 42'" we get the error:
    c:\Programs\ruby-1.9\bin\ruby.exe: invalid switch in RUBYOPT: -C (RuntimeError)

    The error is fixed when removing the minus sign in configure.in (line 22). (Why is there a minus sign in RUBYOPT?)
    "RUBYOPT=- /c/Programs/ruby-1.9/bin/ruby.exe -e 'p 42'"

  5. SUGGESTED FIX
    1. remove the - sign in configure.in (line 22)
    RUBYOPT='' $BASERUBY -e 'p 42' 2>/dev/null" = 42
    2. remove the - sign in "common.mk" (line 8)

  6. CONFIGURATION:
    - Mingw / win32
    - autoconf 2.63
    - baseruby 1.8.7 or 1.9.1
    =end

Actions #1

Updated by luislavena (Luis Lavena) about 14 years ago

=begin
Hello Christian,

You're using MinGW and providing a MSYS/Cygwin PATH to an existing version. MinGW != MSYS path, you should be using standard Windows path for it.

Did you by chance tried RubyInstaller building recipes?

It is hosted on GitHub:

http://github.com/oneclick/rubyinstaller

--
Luis Lavena

=end

Actions #2

Updated by sirk390 (Christian Bodt) about 14 years ago

=begin
Hi Luis,

Thanks for your help,
Could you tell me if I understood correctly what 'windows path' you mean? I am using msys+mingw and the standard bash shell to compile.

Folling your advice, I tried running the command (as in configue.in line 22) :
"RUBYOPT=- 'c:\Programs\ruby-1.9\bin\ruby.exe' -e 'p 42'"

It fails in the same way as before (c:\Programs\ruby-1.9\bin\ruby.exe: invalid switch in RUBYOPT: -C (RuntimeError)).

The following fails also:

export RUBYOPT=-
ruby.exe -e 'p 42'
c:\Programs\ruby-1.9\bin\ruby.exe: invalid switch in RUBYOPT: -C (RuntimeError)

Using the windows "cmd.exe" shell, the - option seems to be accepted:

set RUBYOPT=-
ruby.exe -e 'p 42'
42

I think I will try RubyInstaller :) It sound quite simple.

Thanks a lot,
Christian

=end

Actions #3

Updated by hgs (Hugh Sasse) about 14 years ago

=begin
What happens if you change the command line, rather
than the RUBYOPT line:

./configure --with-baseruby='c:\Programs\ruby-1.9\bin\ruby.exe'

(I've never tried this, so don't know if it will work, it just seems to be in line with what Luis described, given yours didn't work.)

HTH, Hugh
=end

Actions #4

Updated by sirk390 (Christian Bodt) about 14 years ago

=begin
Hi,

I just tried it and it fails in the same way : 'executable host ruby is required. use --with-baseruby option.' during make.

The "RUBYOPT line" test is my isolation of that problem.

$ ./configure --with-baseruby='c:\Programs\ruby-1.9\bin\ruby.exe'
(...)
configure: creating ./config.status
config.status: creating GNUmakefile
config.status: creating Makefile

$ make
gcc -O3 -g -Wall -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-
strings -Wno-long-long -I. -I.ext/include/i386-mingw32 -I./include -I. -DRUBY_EX
PORT -o main.o -c main.c
gcc -O3 -g -Wall -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-
strings -Wno-long-long -I. -I.ext/include/i386-mingw32 -I./include -I. -DRUBY_EX
PORT -o dln.o -c dln.c
gcc -O3 -g -Wall -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-
strings -Wno-long-long -I. -I.ext/include/i386-mingw32 -I./include -I. -DRUBY_EX
PORT -o dmydln.o -c dmydln.c
gcc -O3 -g -Wall -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-
strings -Wno-long-long -I. -I.ext/include/i386-mingw32 -I./include -I. -DRUBY_EX
PORT -o dmyencoding.o -c dmyencoding.c
gcc -O3 -g -Wall -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-
strings -Wno-long-long -I. -I.ext/include/i386-mingw32 -I./include -I. -DRUBY_EX
PORT -o version.o -c version.c
gcc -O3 -g -Wall -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-
strings -Wno-long-long -I. -I.ext/include/i386-mingw32 -I./include -I. -DRUBY_EX
PORT -o dmyversion.o -c dmyversion.c
echo executable host ruby is required. use --with-baseruby option.; false -I. .
/tool/compile_prelude.rb ./prelude.rb miniprelude.c
executable host ruby is required. use --with-baseruby option.
make: *** [miniprelude.c] Error 1

=end

Actions #5

Updated by luislavena (Luis Lavena) about 14 years ago

=begin
Christian,

Please indicate which source package of 1.9.1 are you using (and where you downloaded) in case was subversion, check if you have the latest release.

If using Subversion, also try with 1.9.2 (trunk) and see if the problem persist there.

A recommendation: if you have ruby in the path, baseruby will be determined automatically, no need to indicate it, only if you want to use a different ruby version than the one available in the system.

Second, please try this format to path:

./configure --with-baseruby="C:/Foo/Bar/Ruby-1.9/bin/ruby.exe"

And also verify that "Programs" is actually programs and not Program Files ;-)

Good luck,

Luis Lavena

=end

Actions #6

Updated by nobu (Nobuyoshi Nakada) about 14 years ago

  • Status changed from Open to Rejected

=begin
It's an issue of msys shell or the runtime library.
Seems the first slash was mistakenly converted to a hyphen, as an option switch.
=end

Actions #7

Updated by nobu (Nobuyoshi Nakada) about 14 years ago

  • Status changed from Rejected to Third Party's Issue

=begin

=end

Actions #8

Updated by hgs (Hugh Sasse) about 14 years ago

=begin
That suggests something along the lines of:

./configure --with-baseruby=/c/Programs/ruby-1.9/bin/

or with maybe just one backslash might work....
=end

Actions #9

Updated by sirk390 (Christian Bodt) about 14 years ago

=begin
Yes, I agree it's an msys or runtime library issue.
The following program shows the consequences on the RUBYOPT variable:


#include <stdio.h>

int main(int argc, char**argv)
{
printf("%s", getenv("RUBYOPT"));
}


gcc main.c
RUBYOPT=- a.exe
-C:/Programs/msys1.0/r
RUBYOPT=ABC a.exe
ABC


Note: It doesn't seem to happen when current directory in top level or first level.

Thanks a lot,
Christian

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0