# Compilation and installation of Ruby 1.9

**URL:** <https://www.ruby-forum.com/t/compilation-and-installation-of-ruby-1-9/109115>\
**Category:** Ruby\
**Created:** [July 11, 2007, 4:07pm UTC](https://www.ruby-forum.com/t/compilation-and-installation-of-ruby-1-9/109115 "2007-07-11T16:07:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chirag\_mistry\_ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ec9cab/32.png) [@chirag\_mistry\_ruby](https://www.ruby-forum.com/u/chirag_mistry_ruby)\
**Post date:** [July 11, 2007, 4:07pm UTC](https://www.ruby-forum.com/t/compilation-and-installation-of-ruby-1-9/109115/1 "2007-07-11T16:07:56Z")

</div>

Hi

This message is regarding the errors and warnings I got while  
compiling Ruby 1.9. I have downloaded the Ruby 1.9 source code from  
the link [http://svn.ruby-lang.org/repos/ruby/trunk/](http://svn.ruby-lang.org/repos/ruby/trunk/) and I try to  
compile the code but I was getting many compile time errors. I have  
done some changes in configuration file and source code to solve those  
errors and warnings but still I am getting few errors. Please give  
your feedback so I can successfully compile and install Ruby 1.9.  
Below is the detail description about errors and warnings.

Machine/OS information for my machine:  
OS: GNU/Linux  
Kernel: 2.4.21-40.ELsmp  
Kernel Version: #1 SMP Thu Feb 2 22:22:39 EST 2006  
Processor: i686  
Hardware-platform - i386

Below are details about errors and warnings.

## First I got this error:

## rm -f ruby /opt/ruby/ruby-1.8.6/ruby ./tool/insns2vm.rb --srcdir=“.” ./tool/insns2vm.rb:3:in `require’: no such file to load – optparse (LoadError) from ./tool/insns2vm.rb:3 make: \*\*\* [optinsn.inc] Error 1

I export RUBYLIB=“./lib” to solve this error.

## The next error I got was:

## rm -f ruby ruby ./tool/insns2vm.rb --srcdir=“.” ./tool/insns2vm.rb:7:in `require’: ./tool/…/lib/vm/instruction.rb: 105: syntax error (SyntaxError) load\_insns\_def opts[:“insns.def”] || ‘insns.def’ ^ ./tool/…/lib/vm/instruction.rb:107: syntax error load\_opt\_operand\_def opts[:“opope.def”] || ‘opt\_operand.def’ ^ ./tool/…/lib/vm/instruction.rb:108: syntax error load\_insn\_unification\_def opts[:“unif.def”] || ‘opt\_insn\_unif.def’ ^ ./tool/…/lib/vm/instruction.rb:114: syntax error %w[use\_const verbose].each do |attr| ^ ./tool/…/lib/vm/instruction.rb:115: syntax error ./tool/…/lib/vm/instruction.rb:144: syntax error vpath.open(file) do |f| ^ ./tool/…/lib/vm/instruction.rb:145: syntax error ./tool/…/lib/vm/instruction.rb:150: syntax error from ./tool/insns2vm.rb:7 make: \*\*\* [optinsn.inc] Error 1

The reason for this error was the version of ruby. The ruby binary “/  
usr/bin/ruby” having version ruby 1.6.8 (2002-12-24) [i386-linux-gnu].  
To solve it: The ruby 1.8.6 is already installed on my machine. I have  
changed the “BASERUBY = /opt/ruby/ruby-1.8.6/ruby” (Earlier It was  
“BASERUBY = ruby”) at line no 1661 in file configure.in and follow all  
steps of compilation from the beginning (Means regenerate configure  
and then Makefile).

## The next error I got was:

## In file included from thread.c:150: thread\_pthread.ci:90:1: directives may not be used inside a macro argument thread\_pthread.ci:89:65: unterminated argument list invoking macro “NOINLINE” In file included from thread.c:150: thread\_pthread.ci:93: syntax error before ‘)’ token thread.c:280: warning: `thread_start_func_2' was declared implicitly `extern’ and later `static' thread_pthread.ci:114: warning: previous declaration of `thread\_start\_func\_2’ make: \*\*\* [thread.o] Error 1

To solve this error, I have commented line no 90, 91 and 92 in file  
thread\_pthread.ci.  
Below is a snapshot of changed thread\_pthread.ci file.

* * *

NOINLINE(static int thread\_start\_func\_2(rb\_thread\_t \*th, VALUE  
\*stack\_start  
//#ifdef \_\_ia64  
// , VALUE \*register\_stack\_start  
//#endif  
));

* * *

## I was getting a below warning for many of the files:

## yarvcore.h:614: warning: `fastcall’ attribute directive ignored

To solve this warning, I have done below changes at line no 614 in  
yarvcore.h file.  
Snapshot before change for the line 614 in yarvcore.h file:

* * *

typedef rb\_control\_frame\_t \*  
(FUNC\_FASTCALL(\*rb\_insn\_func\_t))(rb\_thread\_t \*,  
rb\_control\_frame\_t \*);

* * *

Snapshot after change for the line 614 in yarvcore.h file:

* * *

typedef rb\_control\_frame\_t \* (\*rb\_insn\_func\_t)(rb\_thread\_t \*,  
rb\_control\_frame\_t \*);

* * *

## Now I am getting this error and I can not able to solve it:

## rbconfig.rb unchanged /users/chiragm/UnoRuby/ruby\_1.9\_sourcecode/lib/fileutils.rb:1026:in `method_missing': private method `open’ called for false:FalseClass (NoMethodError) from /users/chiragm/UnoRuby/ruby\_1.9\_sourcecode/lib/ fileutils.rb:1026:in `rescue in block in touch' from /users/chiragm/UnoRuby/ruby_1.9_sourcecode/lib/ fileutils.rb:1022:in `block in touch’ from /users/chiragm/UnoRuby/ruby\_1.9\_sourcecode/lib/ fileutils.rb:1020:in `each' from /users/chiragm/UnoRuby/ruby_1.9_sourcecode/lib/ fileutils.rb:1020:in `touch’ from ./mkconfig.rb:188:in `’ make: \*\*\* [.rbconfig.time] Error 1
