Same question but different account - installing Ruby to Desktop folder as if I used "sudo apt-get install rubyX rubyX-dev"

Hello all.

I want to install ruby in a certain folder, and by using configure's
PREFIX and EXECPREFIX, etc., keep the installation all contained in this
folder. For instance a folder on my desktop, called Ruby, e.g.
~/Desktop/Ruby

I tried both,

$ svn co http://svn.ruby-lang.org/repos/ruby/trunk ruby

and

$ svn co http://svn.ruby-lang.org/repos/ruby/branches/ruby_2_3

but I kept running into errors about not finding header files like
ruby.h. So it was suggested I do

apt-get install rubyX rubyX-dev

but I really want it all self-contained in the folder on my desktop,
much like Anaconda/Python is.

So how do I install the equivalent of rubyX and rubyX-dev (via apt) in
my Desktop folder using git or svn?

Thanks much!
Brett

Quoting steve.sbh77 (steve.sbh77@gmail.com):

I tried both,

$ svn co http://svn.ruby-lang.org/repos/ruby/trunk ruby

and

$ svn co http://svn.ruby-lang.org/repos/ruby/branches/ruby_2_3

but I kept running into errors about not finding header files like
ruby.h.

You are not specifying which errors, so it is difficult to help.

After you have obtained your source repository, what do you do? If you
get the current, latest version, as per the first command you show,
you can run

autoreconf -fi

to obtain the configure script. Then, if you run

./configure --help

among other interesting information, you can read:

--8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--
Installation directories:
  --prefix=PREFIX install architecture-independent files in PREFIX
                          [/usr/local]
  --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
                          [PREFIX]

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc. You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.
--8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--

So: the way to to make an installation that resides in a non-standard
location is clearly indicated. Then, you will have executables,
libraries and include files installed in non-standard places, of
course. It is part of system administration practice (I imagine you
are under Linux) to configure things so that you can use all of those
elements. You can succeed, but you must learn your whereabouts. It may
look like a hurdles race.

apt-get install rubyX rubyX-dev

There I cannot help you anymore. I stopped using debian and
derivatives when systemd entered into that picture.

Carlo

···

Subject: same question but different account - installing Ruby to Desktop folder as if I used "sudo apt-get install rubyX rubyX-dev"
  Date: lun 05 set 16 01:20:12 -0600

--
  * Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
  * di parlare tanto di amore e di rettitudine? (Chuang-Tzu)

Thank you for your reply Carlo. I realize what I meant to ask was
(though I guess I really didn't) if downloading from one (or either?) of
the svn addresses would result in a full Ruby installation, such as what
one would have if they did "sudo apt-get install ruby24 ruby24-dev".

Maybe my dilemma is more on the part of redmine but due to what I'm
getting back on SE I thought I might have grabbed the wrong ruby.

My full question in all its horrible glory is here on SO;

Is this clear?

Thanks all,
Brett

0x9E50670B.asc (3.05 KB)

···

On 09/05/2016 10:41 PM, Carlo E. Prelz wrote:

  Subject: same question but different account - installing Ruby to Desktop folder as if I used "sudo apt-get install rubyX rubyX-dev"
  Date: lun 05 set 16 01:20:12 -0600

Quoting steve.sbh77 (steve.sbh77@gmail.com):

I tried both,

$ svn co http://svn.ruby-lang.org/repos/ruby/trunk ruby

and

$ svn co http://svn.ruby-lang.org/repos/ruby/branches/ruby_2_3

but I kept running into errors about not finding header files like
ruby.h.

You are not specifying which errors, so it is difficult to help.

After you have obtained your source repository, what do you do? If you
get the current, latest version, as per the first command you show,
you can run

autoreconf -fi

to obtain the configure script. Then, if you run

./configure --help

among other interesting information, you can read:

--8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--
Installation directories:
  --prefix=PREFIX install architecture-independent files in PREFIX
                          [/usr/local]
  --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
                          [PREFIX]

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc. You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.
--8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--

So: the way to to make an installation that resides in a non-standard
location is clearly indicated. Then, you will have executables,
libraries and include files installed in non-standard places, of
course. It is part of system administration practice (I imagine you
are under Linux) to configure things so that you can use all of those
elements. You can succeed, but you must learn your whereabouts. It may
look like a hurdles race.

apt-get install rubyX rubyX-dev

There I cannot help you anymore. I stopped using debian and
derivatives when systemd entered into that picture.

Carlo

Quoting steve.sbh77 (steve.sbh77@gmail.com):

Thank you for your reply Carlo. I realize what I meant to ask was
(though I guess I really didn't) if downloading from one (or either?) of
the svn addresses would result in a full Ruby installation, such as what
one would have if they did "sudo apt-get install ruby24 ruby24-dev".

That way you get Matz's official *source* for ruby. Having compiled
software packages for decades, I can guarantee that compiling Ruby is
as easy as can get.

Once you have compiled Ruby, you have the interpreter and the
libraries for linking external gems that include C extensions. You do
have the 'gem' command, that allows you to load whatever extension you
need that happens to be distributed in gem format. Having said that, I
admit ignorance in that I have no idea about what 'ruby24' is. The
impression I get from your errors is that Ruby's 'make install' has
not been run. Otherwise ruby.h would be where your version of Ruby
expects to find it when executing the 'extconf.rb' scripts of the
various C extensions that you happen to be trying to compile.

Maybe my dilemma is more on the part of redmine but due to what I'm
getting back on SE I thought I might have grabbed the wrong ruby.

My full question in all its horrible glory is here on SO;

ruby.h library(ies) not found despite make check success; when building redmine - Stack Overflow

Is this clear?

As clear as the fact that I never used redmine or rails... What I know
is how to build Ruby.

This guide I found on the redmine site shows a possible path to follow
once you have working ruby and gem executables (that means that you
must have compiled and installed the ruby code you have downloaded):

The path looks twisty and full of possible pitfalls... The fact that
you appear to be on osx does not facilitate things.

Since redmine requires rails, you may have more luck knocking at a
rails-focused forum.

Carlo

···

Subject: Re: same question but different account - installing Ruby to Desktop folder as if I used "sudo apt-get install rubyX rubyX-dev"
  Date: Tue 06 Sep 16 09:17:49AM -0600

--
  * Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
  * di parlare tanto di amore e di rettitudine? (Chuang-Tzu)

Thank you yet again Carlo,

Just one question before I look to try some of the things in the link
you kindly provided.... If "make check" succeeds, as well as simply
calling "ruby -v", doesn't this mean that the "make install" did in fact
work?

I did this:

svn co ....
autoconf
./configure ...
make
make check
make install

So after all this "make check" did succeed, and so does "ruby -v", as
well as the "gem install" on *some* gems, but not all. Those it fails
for are the ones that complain about missing ruby.h because it/they
expect it elsewhere, apparently.

Thank you again,
Brett

P.S. Maybe I will try "make distclean" and start over too...

···

On 09/06/2016 02:03 PM, Carlo E. Prelz wrote:

  Subject: Re: same question but different account - installing Ruby to Desktop folder as if I used "sudo apt-get install rubyX rubyX-dev"
  Date: Tue 06 Sep 16 09:17:49AM -0600

Quoting steve.sbh77 (steve.sbh77@gmail.com):

Thank you for your reply Carlo. I realize what I meant to ask was
(though I guess I really didn't) if downloading from one (or either?) of
the svn addresses would result in a full Ruby installation, such as what
one would have if they did "sudo apt-get install ruby24 ruby24-dev".

That way you get Matz's official *source* for ruby. Having compiled
software packages for decades, I can guarantee that compiling Ruby is
as easy as can get.

Once you have compiled Ruby, you have the interpreter and the
libraries for linking external gems that include C extensions. You do
have the 'gem' command, that allows you to load whatever extension you
need that happens to be distributed in gem format. Having said that, I
admit ignorance in that I have no idea about what 'ruby24' is. The
impression I get from your errors is that Ruby's 'make install' has
not been run. Otherwise ruby.h would be where your version of Ruby
expects to find it when executing the 'extconf.rb' scripts of the
various C extensions that you happen to be trying to compile.

Maybe my dilemma is more on the part of redmine but due to what I'm
getting back on SE I thought I might have grabbed the wrong ruby.

My full question in all its horrible glory is here on SO;

ruby.h library(ies) not found despite make check success; when building redmine - Stack Overflow

Is this clear?

As clear as the fact that I never used redmine or rails... What I know
is how to build Ruby.

This guide I found on the redmine site shows a possible path to follow
once you have working ruby and gem executables (that means that you
must have compiled and installed the ruby code you have downloaded):

InstallRedmineOnDebianStableApacheMysqlPassenger - Redmine

The path looks twisty and full of possible pitfalls... The fact that
you appear to be on osx does not facilitate things.

Since redmine requires rails, you may have more luck knocking at a
rails-focused forum.

Carlo

Quoting steve.sbh77 (steve.sbh77@gmail.com):

P.S. Maybe I will try "make distclean" and start over too...

When I do 'make install,' the outupt I receve includes the lines

...
installing common headers: /usr/local/include/ruby-2.4.0
...
installing extension headers: /usr/local/include/ruby-2.4.0/x86_64-linux
...

and, indeed, ruby.h is found at /usr/local/include/ruby-2.4.0.
You may want to post the actual output of your 'make install'
command.

You mention that you execute 'ruby -v'. Are you sure that you are
running the executable you just compiled? You said you wanted to
install the new copy in a non-standard location. What does

which ruby

returns? It is non-trivial to run anything complex from a non-standard
location. It may well be that you have multiple installations of Ruby,
and that in some phases of the process you mix up things.

Carlo

···

Subject: Re: same question but different account - installing Ruby to Desktop folder as if I used "sudo apt-get install rubyX rubyX-dev"
  Date: mar 06 set 16 02:19:19 -0600

--
  * Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
  * di parlare tanto di amore e di rettitudine? (Chuang-Tzu)

Hello again, I ran the making process again...

···

On 09/06/2016 10:47 PM, Carlo E. Prelz wrote:

Subject: Re: same question but different account - installing Ruby
to Desktop folder as if I used "sudo apt-get install rubyX rubyX-dev"
Date: mar 06 set 16 02:19:19 -0600

Quoting steve.sbh77 (steve.sbh77@gmail.com):

P.S. Maybe I will try "make distclean" and start over too...

When I do 'make install,' the outupt I receve includes the lines

... installing common headers: /usr/local/include/ruby-2.4.0 ...
installing extension headers:
/usr/local/include/ruby-2.4.0/x86_64-linux ...

and, indeed, ruby.h is found at /usr/local/include/ruby-2.4.0. You
may want to post the actual output of your 'make install' command.

The output of 'make install' is;

*********************
sbh@sbh-laptop-M18 ~/SW/Ruby/dev/ruby $ make install
  CC = gcc
  LD = ld
  LDSHARED = gcc -shared
  CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter
-Wno-parentheses -Wno-long-long -Wno-missing-field-initializers
-Wno-tautological-compare -Wno-parentheses-equality
-Wno-constant-logical-operand -Wno-self-assign -Wunused-variable
-Werror=implicit-int -Werror=pointer-arith -Werror=write-strings
-Werror=declaration-after-statement
-Werror=implicit-function-declaration -Werror=deprecated-declarations
-Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn
-Wsuggest-attribute=format -Wno-maybe-uninitialized -std=gnu99
  XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow
-fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -fPIE
  CPPFLAGS = -I. -I.ext/include/x86_64-linux -I./include -I.
-I./enc/unicode/8.0.0
  DLDFLAGS = -fstack-protector -pie
  SOLIBS =
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
5.4.0-6ubuntu1~16.04.2'
--with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs
--enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++
--prefix=/usr --program-suffix=-5 --enable-shared
--enable-linker-build-id --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --libdir=/usr/lib
--enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin
--with-system-zlib --disable-browser-plugin --enable-java-awt=gtk
--enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre
--enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64
--with-arch-directory=amd64
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc
--enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.2)
generating enc.mk
making srcs under enc
make[1]: Entering directory '/home/sbh/SW/Ruby/dev/ruby'
make[1]: Nothing to be done for 'srcs'.
make[1]: Leaving directory '/home/sbh/SW/Ruby/dev/ruby'
generating transdb.h
transdb.h unchanged
generating makefile exts.mk
make[1]: Entering directory '/home/sbh/SW/Ruby/dev/ruby'
make[2]: Entering directory '/home/sbh/SW/Ruby/dev/ruby/ext/bigdecimal'
make[2]: Leaving directory '/home/sbh/SW/Ruby/dev/ruby/ext/bigdecimal'
make[2]: Entering directory '/home/sbh/SW/Ruby/dev/ruby/ext/date'
make[2]: Leaving directory '/home/sbh/SW/Ruby/dev/ruby/ext/date'
make[2]: Entering directory '/home/sbh/SW/Ruby/dev/ruby/ext/digest'
make[2]: Leaving directory '/home/sbh/SW/Ruby/dev/ruby/ext/digest'
make[2]: Entering directory '/home/sbh/SW/Ruby/dev/ruby/ext/digest/sha2'
make[2]: Leaving directory '/home/sbh/SW/Ruby/dev/ruby/ext/digest/sha2'
make[2]: Entering directory '/home/sbh/SW/Ruby/dev/ruby/ext/fiddle'
make[2]: Leaving directory '/home/sbh/SW/Ruby/dev/ruby/ext/fiddle'
make[2]: Entering directory '/home/sbh/SW/Ruby/dev/ruby/ext/io/console'
make[2]: Leaving directory '/home/sbh/SW/Ruby/dev/ruby/ext/io/console'
make[2]: Entering directory '/home/sbh/SW/Ruby/dev/ruby/ext/json'
make[2]: Leaving directory '/home/sbh/SW/Ruby/dev/ruby/ext/json'
make[2]: Entering directory '/home/sbh/SW/Ruby/dev/ruby/ext/nkf'
make[2]: Leaving directory '/home/sbh/SW/Ruby/dev/ruby/ext/nkf'
make[2]: Entering directory '/home/sbh/SW/Ruby/dev/ruby/ext/openssl'
make[2]: Leaving directory '/home/sbh/SW/Ruby/dev/ruby/ext/openssl'
make[2]: Entering directory '/home/sbh/SW/Ruby/dev/ruby/ext/pathname'
make[2]: Leaving directory '/home/sbh/SW/Ruby/dev/ruby/ext/pathname'
make[2]: Entering directory '/home/sbh/SW/Ruby/dev/ruby/ext/psych'
make[2]: Leaving directory '/home/sbh/SW/Ruby/dev/ruby/ext/psych'
make[2]: Entering directory '/home/sbh/SW/Ruby/dev/ruby/ext/pty'
make[2]: Leaving directory '/home/sbh/SW/Ruby/dev/ruby/ext/pty'
make[2]: Entering directory '/home/sbh/SW/Ruby/dev/ruby/ext/ripper'
make[2]: Leaving directory '/home/sbh/SW/Ruby/dev/ruby/ext/ripper'
make[2]: Entering directory '/home/sbh/SW/Ruby/dev/ruby/ext/socket'
make[2]: Leaving directory '/home/sbh/SW/Ruby/dev/ruby/ext/socket'
make[2]: Entering directory '/home/sbh/SW/Ruby/dev/ruby/ext/syslog'
make[2]: Leaving directory '/home/sbh/SW/Ruby/dev/ruby/ext/syslog'
make[2]: Entering directory '/home/sbh/SW/Ruby/dev/ruby'
make[2]: 'ruby' is up to date.
make[2]: Leaving directory '/home/sbh/SW/Ruby/dev/ruby'
make[1]: Leaving directory '/home/sbh/SW/Ruby/dev/ruby'
making enc
make[1]: Entering directory '/home/sbh/SW/Ruby/dev/ruby'
make[1]: Nothing to be done for 'enc'.
make[1]: Leaving directory '/home/sbh/SW/Ruby/dev/ruby'
making trans
make[1]: Entering directory '/home/sbh/SW/Ruby/dev/ruby'
make[1]: Nothing to be done for './enc/trans'.
make[1]: Leaving directory '/home/sbh/SW/Ruby/dev/ruby'
making encs
make[1]: Entering directory '/home/sbh/SW/Ruby/dev/ruby'
make[1]: Nothing to be done for 'encs'.
make[1]: Leaving directory '/home/sbh/SW/Ruby/dev/ruby'
Generating RDoc documentation

No newer files.

  Files: 0

  Classes: 0 (0 undocumented)
  Modules: 0 (0 undocumented)
  Constants: 0 (0 undocumented)
  Attributes: 0 (0 undocumented)
  Methods: 0 (0 undocumented)

  Total: 0 (0 undocumented)
    0.00% documented

  Elapsed: 0.0s

./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext
-- --disable-gems -r./x86_64-linux-fake ./tool/rbinstall.rb
--make="make" --dest-dir="" --extout=".ext" --mflags="" --make-flags=""
--data-mode=0644 --prog-mode=0755 --installed-list .installed.list
--mantype="doc" --install=all --rdoc-output=".ext/rdoc"
installing binary commands: /home/sbh/SW/Ruby/dev/execprefix/bin
installing base libraries: /home/sbh/SW/Ruby/dev/execprefix/lib
installing arch files:
/home/sbh/SW/Ruby/dev/execprefix/lib/ruby/2.4.0/x86_64-linux
installing pkgconfig data: /home/sbh/SW/Ruby/dev/execprefix/lib/pkgconfig
installing command scripts: /home/sbh/SW/Ruby/dev/execprefix/bin
installing library scripts:
/home/sbh/SW/Ruby/dev/execprefix/lib/ruby/2.4.0
installing common headers:
/home/sbh/SW/Ruby/dev/prefix/include/ruby-2.4.0
installing manpages: /home/sbh/SW/Ruby/dev/prefix/share/man/man1
installing extension objects:
/home/sbh/SW/Ruby/dev/execprefix/lib/ruby/2.4.0/x86_64-linux
installing extension objects:
/home/sbh/SW/Ruby/dev/execprefix/lib/ruby/site_ruby/2.4.0/x86_64-linux
installing extension objects:
/home/sbh/SW/Ruby/dev/execprefix/lib/ruby/vendor_ruby/2.4.0/x86_64-linux
installing extension headers:
/home/sbh/SW/Ruby/dev/prefix/include/ruby-2.4.0/x86_64-linux
installing extension scripts:
/home/sbh/SW/Ruby/dev/execprefix/lib/ruby/2.4.0
installing extension scripts:
/home/sbh/SW/Ruby/dev/execprefix/lib/ruby/site_ruby/2.4.0
installing extension scripts:
/home/sbh/SW/Ruby/dev/execprefix/lib/ruby/vendor_ruby/2.4.0
installing extension headers:
/home/sbh/SW/Ruby/dev/prefix/include/ruby-2.4.0/ruby
installing default gems:
/home/sbh/SW/Ruby/dev/execprefix/lib/ruby/gems/2.4.0 (build_info, cache,
doc, extensions, gems, specifications)
                              bigdecimal 1.2.8
                              io-console 0.4.6
                              json 2.0.2
                              openssl 2.0.0.beta.1
                              psych 2.1.0
                              rdoc 4.2.1
installing bundle gems:
/home/sbh/SW/Ruby/dev/execprefix/lib/ruby/gems/2.4.0 (build_info, cache,
doc, extensions, gems, specifications)
installing rdoc:
/home/sbh/SW/Ruby/dev/prefix/share/ri/2.4.0/system
installing capi-docs: /home/sbh/SW/Ruby/dev/prefix/share/doc/ruby
*********************

which, I believe, shows that everything is installed under the root
/home/sbh/SW/Ruby/dev/

You mention that you execute 'ruby -v'. Are you sure that you are
running the executable you just compiled? You said you wanted to
install the new copy in a non-standard location. What does

which ruby

returns?

I'm not sure why things like Ruby and SBCL (Lisp) need themselves to be
installed first before they can be installed... so, I used apt-get to
install an older version.

This is what I get;

sbh@sbh-laptop-M18 ~/SW/Ruby/dev/execprefix/bin $
/home/sbh/SW/Ruby/dev/execprefix/bin/ruby -v
ruby 2.4.0dev (2016-09-05 trunk 56071) [x86_64-linux]

or ./ruby -v from the same directory. Without the full path, I would use
the apt-get one,

sbh@sbh-laptop-M18 ~/SW/Ruby/dev/execprefix/bin $ ruby -v
ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]

which I intend on removing afterwards and adding appropriate paths to
places to use the newer Ruby installation - maybe something like
update-alternatives, though I'm not sure...

Clearly the default, as I had already known, is the apt-get one;

sbh@sbh-laptop-M18 ~/SW/Ruby/dev/execprefix/bin $ which ruby | xargs ls
-Alrt
lrwxrwxrwx 1 root root 7 Mar 13 15:11 /usr/bin/ruby -> ruby2.3

It is non-trivial to run anything complex from a

non-standard location.

I completely agree it is not as easy as just ./configure, but I do this
with most of my software and usually don't run into too many problems.

It may well be that you have multiple

installations of Ruby, and that in some phases of the process you
mix up things.

Carlo

In summary though, the failed installation of *some* of the gems,
request a ruby.h file from;

mkmf.rb can't find header files for ruby at /home/sbh/SW/Ruby
  /dev/execprefix/lib/ruby/include/ruby.h

which does not show up in the 'make install' output.

Thanks much,

Brett

Quoting steve.sbh77 (steve.sbh77@gmail.com):

which, I believe, shows that everything is installed under the root
/home/sbh/SW/Ruby/dev/

You added somewhere this 'execprefix' part to the path. You must have
also used --exec-prefix.

I never used this --exec-prefix configure parameter. How did you
invoke ./configure? You can find the exact parameters you used in the
first lines of the config.log file that is left after you run
configure. If I were you, I'd remove the current /home/sbh/SW/Ruby/dev
directory, and start from scratch from a clean SVN pull:

cd (wherever you want)
rm -rf ruby
svn co http://svn.ruby-lang.org/repos/ruby/trunk ruby
cd ruby
autoreconf -fi
./configure --prefix=/home/sbh/SW/Ruby/dev/
make
make install

Instead of running the new interpreter by specifying its complete
path, did you try to modify the PATH environment variable? Like, with

export PATH=/home/sbh/SW/Ruby/dev/execprefix/bin/:$PATH

? (remove the 'execprefix' part if you recompile as I show above). If
you do that, your new interpreter will be run as default.

You should find your gems' code under

/home/sbh/SW/Ruby/dev/execprefix/lib/ruby/gems/2.4.0/gems

You can monitor that directory. If/when the installation of a gem
fails during the compilation of the C part, you can look at its
directory there. In the directory for the specific gem, there should
be a subdir called 'ext'. Under it ther should be yet another dir with
the name of the gem. There you will find the C stuff that is being
compiled. To see what goes wrong, run

ruby extconf.rb
make

from inside that dir (be sure that you are using your new
interpreter!) An error should be easier to trace from there.

Carlo

···

Subject: Re: same question but different account - installing Ruby to Desktop folder as if I used "sudo apt-get install rubyX rubyX-dev"
  Date: gio 08 set 16 02:07:08 -0600

--
  * Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
  * di parlare tanto di amore e di rettitudine? (Chuang-Tzu)

Hi, apologies as I have been ill and so my response was a little slow :wink:

  Subject: Re: same question but different account - installing Ruby to Desktop folder as if I used "sudo apt-get install rubyX rubyX-dev"
  Date: gio 08 set 16 02:07:08 -0600

Quoting steve.sbh77 (steve.sbh77@gmail.com):

which, I believe, shows that everything is installed under the root
/home/sbh/SW/Ruby/dev/

You added somewhere this 'execprefix' part to the path. You must have
also used --exec-prefix.

I never used this --exec-prefix configure parameter. How did you
invoke ./configure? You can find the exact parameters you used in the
first lines of the config.log file that is left after you run
configure. If I were you, I'd remove the current /home/sbh/SW/Ruby/dev
directory, and start from scratch from a clean SVN pull:

So starting from inside the empty direcotry, "/home/sbh/SW/Ruby/" I did the following as you prescribed.

cd (wherever you want)
rm -rf ruby
svn co http://svn.ruby-lang.org/repos/ruby/trunk ruby
cd ruby
autoreconf -fi

At this point I get;

sbh@sbh-laptop-M18 ~/SW/Ruby/ruby $ autoreconf -fi
aclocal: warning: autoconf input should be named 'configure.ac', not 'configure.in'

Also, due to svn, my old folder name "dev" is now "ruby".

I notice, under ./configure --help, that EPREFIX is by default PREFIX, which in most of the software
I've installed is not the case - hence the habit of mine of making directories "prefix",
"execprefix", etc. I did add "oldincludedir". Therefore using what you suggest;

./configure --prefix=/home/sbh/SW/Ruby/prefix/ --oldincludedir=/home/sbh/SW/Ruby/oldincludedir/

This gave the summary;

Configuration summary for ruby version 2.4.0

   * Installation prefix: /home/sbh/SW/Ruby/prefix
   * exec prefix: ${prefix}
   * arch: x86_64-linux
   * site arch: ${arch}
   * RUBY_BASE_NAME: ruby
   * ruby lib prefix: ${libdir}/${RUBY_BASE_NAME}
   * site libraries path: ${rubylibprefix}/${sitearch}
   * vendor path: ${rubylibprefix}/vendor_ruby
   * target OS: linux
   * compiler: gcc
   * with pthread: yes
   * enable shared libs: no
   * dynamic library ext: so
   * CFLAGS: ${optflags} ${debugflags} ${warnflags}
   * LDFLAGS: -L. -fstack-protector -rdynamic \
                          -Wl,-export-dynamic
   * optflags: -O3 -fno-fast-math
   * debugflags: -ggdb3
   * warnflags: -Wall -Wextra -Wno-unused-parameter \
                          -Wno-parentheses -Wno-long-long \
                          -Wno-missing-field-initializers \
                          -Wno-tautological-compare \
                          -Wno-parentheses-equality \
                          -Wno-constant-logical-operand -Wno-self-assign \
                          -Wunused-variable -Werror=implicit-int \
                          -Werror=pointer-arith -Werror=write-strings \
                          -Werror=declaration-after-statement \
                          -Werror=implicit-function-declaration \
                          -Werror=deprecated-declarations \
                          -Wno-packed-bitfield-compat \
                          -Wsuggest-attribute=noreturn \
                          -Wsuggest-attribute=format \
                          -Wno-maybe-uninitialized
   * strip command: strip -S -x
   * install doc: yes
   * man page type: doc

···

On 09/08/2016 11:34 PM, Carlo E. Prelz wrote:

---

./configure --prefix=/home/sbh/SW/Ruby/dev/
make
make install

For which "make" gave;

...
Generating RI format into /home/sbh/SW/Ruby/ruby/.ext/rdoc...

  Files: 950

  Classes: 1374 ( 560 undocumented)
  Modules: 277 ( 108 undocumented)
  Constants: 2154 ( 590 undocumented)
  Attributes: 1139 ( 248 undocumented)
  Methods: 10471 (2147 undocumented)

  Total: 15415 (3653 undocumented)
   76.30% documented

  Elapsed: 40.4s

"make check" gave;

[ 1324/16508] OpenSSL::TestSSL#test_ctx_options = 0.00s
  1) Failure:
OpenSSL::TestSSL#test_ctx_options [/home/sbh/SW/Ruby/ruby/test/openssl/test_ssl.rb:14]:
<2147486719> expected but was
<2181041151>.

Finished tests in 264.296222s, 62.4337 tests/s, 8427.5628 assertions/s.

16501 tests, 2227373 assertions, 1 failures, 0 errors, 40 skips

ruby -v: ruby 2.4.0dev (2016-09-15 trunk 56164) [x86_64-linux]
uncommon.mk:630: recipe for target 'yes-test-almost' failed
make: *** [yes-test-almost] Error 1

but looking very quickly at this;
Bug #12433: uncommon.mk:614: recipe for target 'yes-test-almost' failed - missing UnicodeData.txt - Ruby master - Ruby Issue Tracking System didn't lead me anywhere yet. And then "make install" put out;

./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems
-r./x86_64-linux-fake ./tool/rbinstall.rb --make="make" --dest-dir="" --extout=".ext" --mflags=""
--make-flags="" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="doc"
--install=all --rdoc-output=".ext/rdoc"
installing binary commands: /home/sbh/SW/Ruby/prefix/bin
installing base libraries: /home/sbh/SW/Ruby/prefix/lib
installing arch files: /home/sbh/SW/Ruby/prefix/lib/ruby/2.4.0/x86_64-linux
installing pkgconfig data: /home/sbh/SW/Ruby/prefix/lib/pkgconfig
installing command scripts: /home/sbh/SW/Ruby/prefix/bin
installing library scripts: /home/sbh/SW/Ruby/prefix/lib/ruby/2.4.0
installing common headers: /home/sbh/SW/Ruby/prefix/include/ruby-2.4.0
installing manpages: /home/sbh/SW/Ruby/prefix/share/man/man1
installing extension objects: /home/sbh/SW/Ruby/prefix/lib/ruby/2.4.0/x86_64-linux
installing extension objects: /home/sbh/SW/Ruby/prefix/lib/ruby/site_ruby/2.4.0/x86_64-linux
installing extension objects: /home/sbh/SW/Ruby/prefix/lib/ruby/vendor_ruby/2.4.0/x86_64-linux
installing extension headers: /home/sbh/SW/Ruby/prefix/include/ruby-2.4.0/x86_64-linux
installing extension scripts: /home/sbh/SW/Ruby/prefix/lib/ruby/2.4.0
installing extension scripts: /home/sbh/SW/Ruby/prefix/lib/ruby/site_ruby/2.4.0
installing extension scripts: /home/sbh/SW/Ruby/prefix/lib/ruby/vendor_ruby/2.4.0
installing extension headers: /home/sbh/SW/Ruby/prefix/include/ruby-2.4.0/ruby
installing default gems: /home/sbh/SW/Ruby/prefix/lib/ruby/gems/2.4.0 (build_info, cache, doc,
extensions, gems, specifications)
                              bigdecimal 1.2.8
                              io-console 0.4.6
                              json 2.0.2
                              openssl 2.0.0.beta.2
                              psych 2.1.1
                              rdoc 5.0.0.beta2
installing bundle gems: /home/sbh/SW/Ruby/prefix/lib/ruby/gems/2.4.0 (build_info, cache, doc,
extensions, gems, specifications)
installing rdoc: /home/sbh/SW/Ruby/prefix/share/ri/2.4.0/system
installing capi-docs: /home/sbh/SW/Ruby/prefix/share/doc/ruby

I haven't tried installing/reinstalling/whatever with redmine yet, until I try a little more on what
this failure means. Maybe it doesn't mean anything but I'm not sure yet.

I do note that I have these ruby.h locations;

sbh@sbh-laptop-M18 ~/SW/Ruby $ find . -name ruby.h -exec ls -Alrt {} \;
-rw-r--r-- 1 sbh sbh 868 Sep 14 19:34 ./ruby/include/ruby.h
-rw-r--r-- 1 sbh sbh 77600 Sep 14 19:34 ./ruby/include/ruby/ruby.h
-rw-r--r-- 1 sbh sbh 868 Sep 14 19:34 ./prefix/include/ruby-2.4.0/ruby.h
-rw-r--r-- 1 sbh sbh 77600 Sep 14 19:34 ./prefix/include/ruby-2.4.0/ruby/ruby.h

and during trying to install redmine, Ruby's gem "install" was expecting ruby.h to be in a path with
"lib/" in it...

Anyway, so now I change the PATH, putting the new ruby at the beginning. I verified it with ruby -v
too.

So I then do;

bundle install --without development test

resulting in a bunch of errors;

sbh@sbh-laptop-M18 ~/SW/Redmine/redmine $ bundle install --without developement test
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Fetching dependency metadata from https://rubygems.org/
Resolving dependencies....
Using rake 11.2.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.9.0
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using pkg-config 1.1.7
Using rack 1.6.4
Using mime-types-data 3.2016.0521
Using arel 6.0.3
Using addressable 2.4.0
Using bundler 1.12.5
Using coderay 1.1.1
Using concurrent-ruby 1.0.2
Using htmlentities 4.3.1
Using thor 0.19.1
Using mimemagic 0.3.2
Using net-ldap 0.12.1
Using ruby-openid 2.3.0
Using rbpdf-font 1.19.0
Installing redcarpet 3.3.4 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory:
/home/sbh/SW/Redmine/redmine/vendor/bundle/ruby/2.3.0/gems/redcarpet-3.3.4/ext/redcarpet
/usr/bin/ruby2.3 -r ./siteconf20160914-8576-9xhgmg.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in
/home/sbh/SW/Redmine/redmine/vendor/bundle/ruby/2.3.0/gems/redcarpet-3.3.4 for inspection.
Results logged to
/home/sbh/SW/Redmine/redmine/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/redcarpet-3.3.4/gem_make.out
Using request_store 1.0.5
Installing rmagick 2.16.0 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory:
/home/sbh/SW/Redmine/redmine/vendor/bundle/ruby/2.3.0/gems/rmagick-2.16.0/ext/RMagick
/usr/bin/ruby2.3 -r ./siteconf20160914-8576-1q1pv7l.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in
/home/sbh/SW/Redmine/redmine/vendor/bundle/ruby/2.3.0/gems/rmagick-2.16.0 for inspection.
Results logged to
/home/sbh/SW/Redmine/redmine/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/rmagick-2.16.0/gem_make.out
Installing sqlite3 1.3.11 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory:
/home/sbh/SW/Redmine/redmine/vendor/bundle/ruby/2.3.0/gems/sqlite3-1.3.11/ext/sqlite3
/usr/bin/ruby2.3 -r ./siteconf20160914-8576-lssjuy.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in
/home/sbh/SW/Redmine/redmine/vendor/bundle/ruby/2.3.0/gems/sqlite3-1.3.11 for inspection.
Results logged to
/home/sbh/SW/Redmine/redmine/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.11/gem_make.out
Using tzinfo 1.2.2
Installing nokogiri 1.6.8 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory:
/home/sbh/SW/Redmine/redmine/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ext/nokogiri
/usr/bin/ruby2.3 -r ./siteconf20160914-8576-aozfjx.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in
/home/sbh/SW/Redmine/redmine/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8 for inspection.
Results logged to
/home/sbh/SW/Redmine/redmine/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/gem_make.out
Using rack-test 0.6.3
Using mime-types 3.1
Using css_parser 1.3.7
Using sprockets 3.7.0
Using rack-openid 1.4.2
Using rbpdf 1.19.0
An error occurred while installing redcarpet (3.3.4), and Bundler cannot continue.
Make sure that `gem install redcarpet -v '3.3.4'` succeeds before bundling.

and so choosing to do what the last line above said, I did this;

gem install redcarpet -v '3.3.4'

which says;

sbh@sbh-laptop-M18 ~/SW/Redmine/redmine $ gem install redcarpet -v '3.3.4'
Building native extensions. This could take a while...
Successfully installed redcarpet-3.3.4
Parsing documentation for redcarpet-3.3.4
Done installing documentation for redcarpet after 0 seconds
1 gem installed

So I think it is okay.... so I run again "bundle install --without development test", and I get the
same error as above - that redcarpet did not work, etc.

I also notice that it is still complaining about the same thing --- header files for ruby at
"/usr/lib/ruby/include/rubh.h"...

Thank you for your time and advice in looking at this.

Best wishes,
Brett

Instead of running the new interpreter by specifying its complete
path, did you try to modify the PATH environment variable? Like, with

export PATH=/home/sbh/SW/Ruby/dev/execprefix/bin/:$PATH

? (remove the 'execprefix' part if you recompile as I show above). If
you do that, your new interpreter will be run as default.

You should find your gems' code under

/home/sbh/SW/Ruby/dev/execprefix/lib/ruby/gems/2.4.0/gems

You can monitor that directory. If/when the installation of a gem
fails during the compilation of the C part, you can look at its
directory there. In the directory for the specific gem, there should
be a subdir called 'ext'. Under it ther should be yet another dir with
the name of the gem. There you will find the C stuff that is being
compiled. To see what goes wrong, run

ruby extconf.rb
make

from inside that dir (be sure that you are using your new
interpreter!) An error should be easier to trace from there.

Carlo

...
...
Therefore using what you suggest;

./configure --prefix=/home/sbh/SW/Ruby/prefix/ --oldincludedir=/home/sbh/SW/Ruby/oldincludedir/

No. I suggested

./configure --prefix=/home/sbh/SW/Ruby/dev/

I never used --oldincludedir but the terse comment I get from
./configure --help (C header files for non-gcc) suggests that this has
nothing to do with installation locations. /home/sbh/SW/Ruby/prefix/
is as good as /home/sbh/SW/Ruby/dev/, provided you decide once and for
all where your installation location will be. Obviously, you have to
include in your $PATH var the CORRECT location:
/home/sbh/SW/Ruby/prefix/bin is different from
/home/sbh/SW/Ruby/dev/bin. Always check with ruby -v to make sure you
are using the right executable.

About the test failure I do not speculate. It has nothing to do with
not finding the ruby.h include file.

I do note that I have these ruby.h locations;

sbh@sbh-laptop-M18 ~/SW/Ruby $ find . -name ruby.h -exec ls -Alrt {} \;
-rw-r--r-- 1 sbh sbh 868 Sep 14 19:34 ./ruby/include/ruby.h
-rw-r--r-- 1 sbh sbh 77600 Sep 14 19:34 ./ruby/include/ruby/ruby.h
-rw-r--r-- 1 sbh sbh 868 Sep 14 19:34 ./prefix/include/ruby-2.4.0/ruby.h
-rw-r--r-- 1 sbh sbh 77600 Sep 14 19:34 ./prefix/include/ruby-2.4.0/ruby/ruby.h

That's correct. The copy from the source repository and the installed file.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory:
/home/sbh/SW/Redmine/redmine/vendor/bundle/ruby/2.3.0/gems/redcarpet-3.3.4/ext/redcarpet
/usr/bin/ruby2.3 -r ./siteconf20160914-8576-9xhgmg.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

As I already wrote, I know nothing about redmine. But from the above
message, it is evident that redmine comes with ITS OWN copy of ruby
(version 2.3.0). This means that the ruby interpreter you poured so
much sweat in compiling is totally ignored by it.

At this point I conclude that the only people that could shed some
light on your problem are those within the redmine community. Since
they include their own version of ruby, their code is probably
incompatible with anything more modern than 2.3. It must also be
tightly coupled with those specific locations. Apparently the
installation puts a ruby2.3 executable under /usr/bin (bad practice, I
believe) but it does not make sure that the include files *it*
requires are also installed.

Carlo

···

--
  * Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
  * di parlare tanto di amore e di rettitudine? (Chuang-Tzu)

Aaahhhh... that all makes a lot of sense... A little disappointing too. Thanks also for verifying to
me the four locations of ruby.h too.

Yes I was aware of the PATH of course and also noted that nothing was even put in oldincludedir
anyways. :slight_smile:

I guess I'll try the redmine community like you suggested.

Thanks for all the effort, time, and explanation; I appreciate it!

Best wishes,
Brett

···

On 09/14/2016 11:08 PM, Carlo E. Prelz wrote:

...
...
Therefore using what you suggest;

./configure --prefix=/home/sbh/SW/Ruby/prefix/ --oldincludedir=/home/sbh/SW/Ruby/oldincludedir/

No. I suggested

./configure --prefix=/home/sbh/SW/Ruby/dev/

I never used --oldincludedir but the terse comment I get from
./configure --help (C header files for non-gcc) suggests that this has
nothing to do with installation locations. /home/sbh/SW/Ruby/prefix/
is as good as /home/sbh/SW/Ruby/dev/, provided you decide once and for
all where your installation location will be. Obviously, you have to
include in your $PATH var the CORRECT location:
/home/sbh/SW/Ruby/prefix/bin is different from
/home/sbh/SW/Ruby/dev/bin. Always check with ruby -v to make sure you
are using the right executable.

About the test failure I do not speculate. It has nothing to do with
not finding the ruby.h include file.

I do note that I have these ruby.h locations;

sbh@sbh-laptop-M18 ~/SW/Ruby $ find . -name ruby.h -exec ls -Alrt {} \;
-rw-r--r-- 1 sbh sbh 868 Sep 14 19:34 ./ruby/include/ruby.h
-rw-r--r-- 1 sbh sbh 77600 Sep 14 19:34 ./ruby/include/ruby/ruby.h
-rw-r--r-- 1 sbh sbh 868 Sep 14 19:34 ./prefix/include/ruby-2.4.0/ruby.h
-rw-r--r-- 1 sbh sbh 77600 Sep 14 19:34 ./prefix/include/ruby-2.4.0/ruby/ruby.h

That's correct. The copy from the source repository and the installed file.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory:
/home/sbh/SW/Redmine/redmine/vendor/bundle/ruby/2.3.0/gems/redcarpet-3.3.4/ext/redcarpet
/usr/bin/ruby2.3 -r ./siteconf20160914-8576-9xhgmg.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

As I already wrote, I know nothing about redmine. But from the above
message, it is evident that redmine comes with ITS OWN copy of ruby
(version 2.3.0). This means that the ruby interpreter you poured so
much sweat in compiling is totally ignored by it.

At this point I conclude that the only people that could shed some
light on your problem are those within the redmine community. Since
they include their own version of ruby, their code is probably
incompatible with anything more modern than 2.3. It must also be
tightly coupled with those specific locations. Apparently the
installation puts a ruby2.3 executable under /usr/bin (bad practice, I
believe) but it does not make sure that the include files *it*
requires are also installed.

Carlo