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.
Description
=begin
-
ACTION
Using win32/MinGW:
./configure --with-baseruby=/c/Programs/ruby-1.9/bin/
(...)
make
-
EXPECTED RESULT
Build is successfull.
-
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
-
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'"
-
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)
-
CONFIGURATION:
- Mingw / win32
- autoconf 2.63
- baseruby 1.8.7 or 1.9.1
=end
=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
=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
=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
=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
=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
- 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
- Status changed from Rejected to Third Party's Issue
=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
=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
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0