# Can't install ruby20



## HoinKyoma (Feb 2, 2014)

I tried to `make install clean` inside /usr/ports/lang/ruby20, but I get an error:


```
root@phone:/usr/ports/lang/ruby20 # make install clean
===>  Building for ruby20-2.0.0.353_4,1
        CC = cc
        LD = ld
        LDSHARED = cc -shared
        CFLAGS = -O3 -fno-fast-math -fno-omit-frame-pointer -I/usr/local/include -O2 -pipe  -fno-strict-aliasing -fPIC
        XCFLAGS = -include ruby/config.h -include ruby/missing.h -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT
        CPPFLAGS =   -I. -I.ext/include/i386-freebsd9 -I./include -I.
        DLDFLAGS = -Wl,-soname,libruby20.so.20 -fstack-protector
        SOLIBS = -lelf -lexecinfo -lpthread -lcrypt -lm -L/usr/local/lib  -Wl,-rpath=/usr/lib:/usr/local/lib -pthread
linking miniruby
array.o: In function `ary_new':
array.c:(.text+0x219a): undefined reference to `__dtraceenabled_ruby___array__create'
array.c:(.text+0x2218): undefined reference to `__dtrace_ruby___array__create'
array.o: In function `empty_ary_alloc':
array.c:(.text+0x2e9e): undefined reference to `__dtraceenabled_ruby___array__create'
array.c:(.text+0x2ec2): undefined reference to `__dtrace_ruby___array__create'
eval.o: In function `setup_exception':
eval.c:(.text+0x2652): undefined reference to `__dtraceenabled_ruby___raise'
eval.c:(.text+0x2699): undefined reference to `__dtrace_ruby___raise'
load.o: In function `rb_require_safe':
load.c:(.text+0x1a5a): undefined reference to `__dtraceenabled_ruby___require__entry'
load.c:(.text+0x1b2d): undefined reference to `__dtraceenabled_ruby___require__return'
load.c:(.text+0x1b5a): undefined reference to `__dtrace_ruby___require__return'
load.c:(.text+0x1b96): undefined reference to `__dtraceenabled_ruby___find__require__entry'
load.c:(.text+0x1ca1): undefined reference to `__dtraceenabled_ruby___find__require__return'
load.c:(.text+0x1dd5): undefined reference to `__dtrace_ruby___require__entry'
load.c:(.text+0x1eac): undefined reference to `__dtrace_ruby___find__require__entry'
load.c:(.text+0x1ede): undefined reference to `__dtrace_ruby___find__require__return'
load.o: In function `rb_f_load':
load.c:(.text+0x2532): undefined reference to `__dtraceenabled_ruby___load__entry'
load.c:(.text+0x258c): undefined reference to `__dtraceenabled_ruby___load__return'
load.c:(.text+0x25b9): undefined reference to `__dtrace_ruby___load__return'
load.c:(.text+0x25fa): undefined reference to `__dtrace_ruby___load__entry'
gc.o: In function `gc_marks':
gc.c:(.text+0x5525): undefined reference to `__dtraceenabled_ruby___gc__mark__begin'
gc.c:(.text+0x564a): undefined reference to `__dtraceenabled_ruby___gc__mark__end'
gc.c:(.text+0x5653): undefined reference to `__dtrace_ruby___gc__mark__end'
gc.c:(.text+0x5676): undefined reference to `__dtrace_ruby___gc__mark__begin'
gc.o: In function `garbage_collect':
gc.c:(.text+0x577c): undefined reference to `__dtraceenabled_ruby___gc__sweep__begin'
gc.c:(.text+0x57ad): undefined reference to `__dtraceenabled_ruby___gc__sweep__end'
gc.c:(.text+0x584c): undefined reference to `__dtrace_ruby___gc__sweep__begin'
gc.c:(.text+0x5856): undefined reference to `__dtrace_ruby___gc__sweep__end'
gc.o: In function `newobj':
gc.c:(.text+0x60ac): undefined reference to `__dtraceenabled_ruby___gc__sweep__begin'
gc.c:(.text+0x60d1): undefined reference to `__dtraceenabled_ruby___gc__sweep__end'
gc.c:(.text+0x6133): undefined reference to `__dtraceenabled_ruby___gc__sweep__begin'
gc.c:(.text+0x6141): undefined reference to `__dtrace_ruby___gc__sweep__begin'
gc.c:(.text+0x6159): undefined reference to `__dtraceenabled_ruby___gc__sweep__end'
gc.c:(.text+0x6163): undefined reference to `__dtrace_ruby___gc__sweep__end'
gc.c:(.text+0x61d6): undefined reference to `__dtrace_ruby___gc__sweep__begin'
gc.c:(.text+0x62c2): undefined reference to `__dtrace_ruby___gc__sweep__end'
hash.o: In function `empty_hash_alloc':
hash.c:(.text+0x377e): undefined reference to `__dtraceenabled_ruby___hash__create'
hash.c:(.text+0x37a2): undefined reference to `__dtrace_ruby___hash__create'
object.o: In function `rb_obj_alloc':
object.c:(.text+0x1a38): undefined reference to `__dtraceenabled_ruby___object__create'
object.c:(.text+0x1aba): undefined reference to `__dtrace_ruby___object__create'
parse.o: In function `yycompile0':
parse.c:(.text+0x198ed): undefined reference to `__dtraceenabled_ruby___parse__begin'
parse.c:(.text+0x19902): undefined reference to `__dtraceenabled_ruby___parse__end'
parse.c:(.text+0x199bd): undefined reference to `__dtraceenabled_ruby___parse__begin'
parse.c:(.text+0x199e4): undefined reference to `__dtrace_ruby___parse__begin'
parse.c:(.text+0x19a44): undefined reference to `__dtrace_ruby___parse__end'
string.o: In function `empty_str_alloc':
string.c:(.text+0x2768): undefined reference to `__dtraceenabled_ruby___string__create'
string.c:(.text+0x278c): undefined reference to `__dtrace_ruby___string__create'
string.o: In function `str_new':
string.c:(.text+0x38d5): undefined reference to `__dtraceenabled_ruby___string__create'
string.c:(.text+0x3a1c): undefined reference to `__dtrace_ruby___string__create'
string.o: In function `rb_str_resurrect':
string.c:(.text+0x54be): undefined reference to `__dtraceenabled_ruby___string__create'
string.c:(.text+0x552b): undefined reference to `__dtrace_ruby___string__create'
vm.o: In function `m_core_hash_from_ary':
vm.c:(.text+0x34f0): undefined reference to `__dtraceenabled_ruby___hash__create'
vm.c:(.text+0x35c0): undefined reference to `__dtrace_ruby___hash__create'
vm.o: In function `rb_iterate':
vm.c:(.text+0x53aa): undefined reference to `__dtraceenabled_ruby___cmethod__return'
vm.c:(.text+0x54bf): undefined reference to `__dtrace_ruby___cmethod__return'
vm.o: In function `vm_call_cfunc':
vm.c:(.text+0x6408): undefined reference to `__dtraceenabled_ruby___cmethod__entry'
vm.c:(.text+0x6571): undefined reference to `__dtraceenabled_ruby___cmethod__return'
vm.c:(.text+0x664d): undefined reference to `__dtrace_ruby___cmethod__return'
vm.c:(.text+0x677f): undefined reference to `__dtrace_ruby___cmethod__entry'
vm.o: In function `.L1798':
vm.c:(.text+0x70dc): undefined reference to `__dtraceenabled_ruby___cmethod__entry'
vm.c:(.text+0x71df): undefined reference to `__dtrace_ruby___cmethod__entry'
vm.c:(.text+0x731e): undefined reference to `__dtraceenabled_ruby___cmethod__return'
vm.c:(.text+0x7434): undefined reference to `__dtrace_ruby___cmethod__return'
vm.o: In function `.L3553':
vm.c:(.text+0xeb2b): undefined reference to `__dtraceenabled_ruby___method__entry'
vm.c:(.text+0xefe7): undefined reference to `__dtraceenabled_ruby___hash__create'
vm.c:(.text+0x11334): undefined reference to `__dtraceenabled_ruby___cmethod__return'
vm.c:(.text+0x11481): undefined reference to `__dtrace_ruby___cmethod__return'
vm.c:(.text+0x11d97): undefined reference to `__dtrace_ruby___hash__create'
vm.c:(.text+0x11fcd): undefined reference to `__dtraceenabled_ruby___method__return'
vm.c:(.text+0x11fda): undefined reference to `__dtraceenabled_ruby___cmethod__entry'
vm.c:(.text+0x11fe7): undefined reference to `__dtraceenabled_ruby___cmethod__return'
vm.c:(.text+0x12c06): undefined reference to `__dtraceenabled_ruby___method__return'
vm.c:(.text+0x12d52): undefined reference to `__dtrace_ruby___method__return'
vm.c:(.text+0x12d61): undefined reference to `__dtraceenabled_ruby___method__entry'
vm.c:(.text+0x12ea9): undefined reference to `__dtrace_ruby___method__entry'
vm.c:(.text+0x12eb3): undefined reference to `__dtraceenabled_ruby___cmethod__entry'
vm.c:(.text+0x13001): undefined reference to `__dtrace_ruby___cmethod__entry'
vm.o: In function `vm_exec':
vm.c:(.text+0x15387): undefined reference to `__dtraceenabled_ruby___method__return'
vm.c:(.text+0x1561a): undefined reference to `__dtraceenabled_ruby___method__return'
vm.c:(.text+0x1573d): undefined reference to `__dtrace_ruby___method__return'
vm.c:(.text+0x159cf): undefined reference to `__dtrace_ruby___method__return'
vm.o: In function `vm_call_bmethod_body':
vm.c:(.text+0x169fd): undefined reference to `__dtraceenabled_ruby___method__entry'
vm.c:(.text+0x16aa9): undefined reference to `__dtraceenabled_ruby___method__return'
vm.c:(.text+0x16b88): undefined reference to `__dtrace_ruby___method__return'
vm.c:(.text+0x16cde): undefined reference to `__dtrace_ruby___method__entry'
*** [miniruby] Error code 1

Stop in /usr/ports/lang/ruby20/work/ruby-2.0.0-p353.
*** [do-build] Error code 1

Stop in /usr/ports/lang/ruby20.
*** [install] Error code 1

Stop in /usr/ports/lang/ruby20.
```

I'm pretty new to FreeBSD so I do not have any idea what to do.  Any tips?


----------



## trh411 (Feb 2, 2014)

Run `portsnap fetch update` to make sure your ports tree is up to date and retry your installation. If that does not resolve the problem, try updating /usr/ports/lang/ruby20/Makefile to include:

```
NO_STAGE=yes
```
and retry your installation.


----------



## HoinKyoma (Feb 2, 2014)

I ran `portsnap fetch update`, then `make install clean` and I still received the same error.  I checked the Makefile and 
	
	



```
NO_STAGE=yes
```


----------



## wblock@ (Feb 2, 2014)

Use `make showconfig` to see if the DEBUG option has been turned on.  If it has, turn it off with `make config`.


----------



## HoinKyoma (Feb 2, 2014)

I ran `make showconfig` and it said,


```
===> The following configuration options are available for ruby20-2.0.0.353_4,1:
     DEBUG=off: Compile-in debug info
     RDOC=off: Build and install Rdoc indexes
===> Use 'make config' to modify these settings
```


----------



## wblock@ (Feb 2, 2014)

The references to dtrace were why I was thinking that.  Have you enabled it somewhere else?


----------



## HoinKyoma (Feb 2, 2014)

I am running a pretty "young" instance of FreeBSD 9.2/i386/dvd1, in virtualbox.  Since its creation, the only thing I have done is install bash, emacs, git, and I have also made a dump.  Everything else is completely default.  I don't recall ever doing anything with regards to dtrace, so it must be in whatever state it was, as per default settings.

Thank you for the help thus far.


----------



## mcarpenter (Feb 25, 2014)

Hi,

I hit exactly the same error on Solaris 11 (also for Ruby 2.1). Workaround:

`./configure --disable-dtrace ... && make`

HTH


----------

