Ruby fails on OSX Lion with rbenv - ruby

I've been trying to install Ruby on my Lion machine (OSX 10.7.3).
I installed rbenv and ruby-build and am trying to get 1.9.2-p290 on my machine. Here is the output of the install failing:
$ rbenv install 1.9.2-p290
Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz...
Installing yaml-0.1.4...
Installed yaml-0.1.4 to /Users/CSC/.rbenv/versions/1.9.2-p290
Downloading http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz...
Installing ruby-1.9.2-p290...
BUILD FAILED
Inspect or clean up the working tree at /var/folders/vm/gcqcld015jx025m7qgtxvw0m0000gn/T/ruby-build.20120301140751.6239
Results logged to /var/folders/vm/gcqcld015jx025m7qgtxvw0m0000gn/T/ruby-build.20120301140751.6239.log
Last 10 log lines:
/usr/bin/gcc-4.2 -I. -I../../../.ext/include/x86_64-darwin11.3.0 -I../../.././include -I../../.././ext/racc/cparse -DRUBY_EXTCONF_H=\"extconf.h\" -I'/Users/SamCouch/.rbenv/versions/1.9.2-p290/include' -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -pipe -o cparse.o -c cparse.c
/usr/bin/gcc-4.2 -dynamic -bundle -o ../../../.ext/x86_64-darwin11.3.0/racc/cparse.bundle cparse.o -L. -L../../.. -L. -L'/Users/SamCouch/.rbenv/versions/1.9.2-p290/lib' -L/usr/local/lib -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace -lpthread -ldl -lobjc
compiling readline
/usr/bin/gcc-4.2 -I. -I../../.ext/include/x86_64-darwin11.3.0 -I../.././include -I../.././ext/readline -DRUBY_EXTCONF_H=\"extconf.h\" -I'/Users/SamCouch/.rbenv/versions/1.9.2-p290/include' -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -pipe -o readline.o -c readline.c
readline.c: In function ‘username_completion_proc_call’:
readline.c:1386: error: ‘username_completion_function’ undeclared (first use in this function)
readline.c:1386: error: (Each undeclared identifier is reported only once
readline.c:1386: error: for each function it appears in.)
make[1]: *** [readline.o] Error 1
make: *** [mkmain.sh] Error 1
I attempted to troubleshoot the issue, but so far I haven't come up with any solution:
$ which gcc
/usr/bin/gcc
$ gcc
i686-apple-darwin11-llvm-gcc-4.2: no input files
$ ruby-build
ruby-build 20120216
usage: ruby-build [-v|--verbose] definition prefix
ruby-build --definitions
Any help would be greatly appreciated!
As a side note, I've tried other similar suggestions posted here, and none have worked for me.

Per ruby-build issue #130 the current workaround is:
env CC=/usr/bin/gcc rbenv install 1.9.3-p125
I've just tested this successfully on a system with:
OS X 10.7.3
Xcode 4.3.1
Command Line Tools for Xcode installed (via Xcode > Preferences > Downloads)
ruby-build # fbfa944
rbenv # 975b45d
Also, pending pull request #137 aims to fix this upstream once and for all.
FWIW, lots of folks are shaking out build chain issues with Xcode 4.3.x since it came out. Expect some instability in any system if you've upgraded to the new toolchain until the collective dust settles.

There seem to be two or three stack overflow questions related to bugs with using rbenv to install ruby 1.9.x on Mac OS X via homebrew / rbenv and I have tried the solutions for many of them without luck. Setting the compiler and installing the apple gcc42 compiler via homebrew didn't help ( brew install apple-gcc42 and CC=/usr/bin/gcc - no luck ) so I'm not sure if they are necessary. I'm using the rbenv manager and so this is what worked for me when trying to install 1.9.3-p385
The problem is with the readline as the log shows:
readline.c: In function ‘username_completion_proc_call’:
readline.c:1499: error: ‘username_completion_function’ undeclared (first use in this function)
readline.c:1499: error: (Each undeclared identifier is reported only once
readline.c:1499: error: for each function it appears in.)
So after looking specifically for that error I found the solution:
Solution:
brew install readline
CONFIGURE_OPTS="--with-readline-dir=$(brew --prefix readline)" rbenv install 1.9.3-p385
You can chance the rbenv install 1.9.3-p385 part of the command to match whatever version is latest or that you are trying to install. Found the note on this blog.

This may be answering on the level of what you need rather than on the level of what you're directly asking, but: have you considered simply using macports (see macports.org) or brew as a way of installing ruby 1.9? It works very well and with much less effort.

It's not exactly what you were asking for but "Can't install Ruby under Lion with RVM – GCC issues" answers how to get Ruby working on Lion with RVM. The errors are pretty similar so you could either:
Use them for some guidance for rbenv troubleshooting, or simply use RVM as described in the top answer to install Ruby that way. It seems like the easier method to me.

Related

rvm ruby installation not working for 2.2 [duplicate]

Here's what I get when I try to install Ruby 2.2:
$ ruby-install ruby 2.2.10
# ...
>>> Compiling ruby 2.2.10 ...
CC = clang
LD = ld
LDSHARED = clang -dynamic -bundle
CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -pipe
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -fPIE
CPPFLAGS = -I/opt/X11/include -I/usr/local/opt/openssl#1.1/include -I/usr/local/opt/readline/include -I/usr/local/opt/libyaml/include -I/usr/local/opt/gdbm/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I. -I.ext/include/x86_64-darwin19 -I./include -I.
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -L/usr/local/opt/openssl#1.1/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/gdbm/lib -fstack-protector -Wl,-u,_objc_msgSend -Wl,-pie -framework CoreFoundation
SOLIBS = -lgmp
Apple clang version 12.0.0 (clang-1200.0.31.1)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
translating probes probes.d
. ./vm_opts.h
file2lastrev.rb: does not seem to be under a vcs: .
make: [.revision.time] Error 1 (ignored)
./revision.h unchanged
compiling main.c
compiling dmydln.c
compiling miniinit.c
compiling miniprelude.c
compiling array.c
compiling bignum.c
compiling class.c
compiling compar.c
compiling complex.c
compiling dir.c
compiling dln_find.c
compiling encoding.c
encoding.c:825:2: error: implicit declaration of function 'rb_str_change_terminator_length' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
rb_str_change_terminator_length(obj, oldtermlen, termlen);
^
1 error generated.
make: *** [encoding.o] Error 1
!!! Compiling ruby 2.2.10 failed!
OS Version: 10.15.6
ruby-install version: 0.7.1
Any ideas on how to debug or fix this? I was previously able to install other versions of 2.2 before I upgraded my OS. I'm also able to install later versions like Ruby 2.7 with no problem
After a lot of breaking my head and realizing that the error has to do with the compilation using GCC that is native to macOS, I decided to do a test.
Because older versions of Ruby need instructions that are no longer present in updated make, it is necessary to download an older version of Command Line Tools for Xcode.
First, remove your actual version with:
sudo rm -rf /Library/Developer/CommandLineTools
Ignore the error about missing git.
Proceed to https://developer.apple.com/download/more/ and download 11.x version of Command Line Tools for Xcode.
I downloaded version 11.5 and it worked.
My return when running gcc -v
Configured with: --prefix = / Library / Developer / CommandLineTools / usr --with-gxx-include-dir = / Library / Developer / CommandLineTools / SDKs / MacOSX.sdk / usr / include / c ++ / 4.2.1
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: / Library / Developer / CommandLineTools / usr / bin
To compare, with recent Command Lines, 12.x, you'll see something like:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.2)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Apparently ignoring the compiler warning is also an option
export optflags="-Wno-error=implicit-function-declaration"
For further duscussion see Problem when installing Ruby 2.2.9 on Mac Big Sur M1
I was able to install that version on Mac 10.15.7 using rvm.
I have openssl#1.1 installed with homebrew. If you run brew info openssl what do you see? I would try brew upgrade openssl first.
Try running
export PKG_CONFIG_PATH="/usr/local/opt/openssl#1.1/lib/pkgconfig" with the info brew returns. Then try rvm install 2.2.10. If that doesn't work I would try rvm install 2.2.10 --with-openssl-dir=/usr/local/opt/openssl --with-openssl-lib=/usr/local/opt/openssl/lib --with-openssl-include=/usr/local/opt/openssl/include just make sure those paths are correct for your system.
You may also need to run
export LDFLAGS="-L/usr/local/opt/openssl#1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl#1.1/include"
beforehand, which will be supplied by brew info.
Adding some extra options here that might help:
We need the right SSL version:
$ brew install rbenv/tap/openssl#1.0
$ rvm install 2.2.10 -C --with-openssl-dir=`brew --prefix openssl#1.0`
First, install open-ssl
brew install rbenv/tap/openssl#1.0
Then
CFLAGS="-Wno-error=implicit-function-declaration" rvm reinstall ruby-2.2.5 --with-openssl-dir='/usr/local/opt/openssl#1.0'
I recently had to install ruby-2.2.0 in Catalina 10.15.7 and was facing the same issues. But luckily managed to get my work done. Steps are as follows:
Installed openssl as a rvm package:
$ rvm pkg install openssl
Ignored compiler warnings:
$ export optflags="-Wno-error=implicit-function-declaration"
Installed required ruby version (2.2.0 in my case) while providing openssl directory parameter and ignoring rubygems:
$ rvm install 2.2.0 --with-openssl-dir=$rvm_path/usr --rubygems ignore

Install Ruby 2.2 on Mac OSX Catalina with ruby-install

Here's what I get when I try to install Ruby 2.2:
$ ruby-install ruby 2.2.10
# ...
>>> Compiling ruby 2.2.10 ...
CC = clang
LD = ld
LDSHARED = clang -dynamic -bundle
CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -pipe
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -fPIE
CPPFLAGS = -I/opt/X11/include -I/usr/local/opt/openssl#1.1/include -I/usr/local/opt/readline/include -I/usr/local/opt/libyaml/include -I/usr/local/opt/gdbm/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I. -I.ext/include/x86_64-darwin19 -I./include -I.
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -L/usr/local/opt/openssl#1.1/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/gdbm/lib -fstack-protector -Wl,-u,_objc_msgSend -Wl,-pie -framework CoreFoundation
SOLIBS = -lgmp
Apple clang version 12.0.0 (clang-1200.0.31.1)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
translating probes probes.d
. ./vm_opts.h
file2lastrev.rb: does not seem to be under a vcs: .
make: [.revision.time] Error 1 (ignored)
./revision.h unchanged
compiling main.c
compiling dmydln.c
compiling miniinit.c
compiling miniprelude.c
compiling array.c
compiling bignum.c
compiling class.c
compiling compar.c
compiling complex.c
compiling dir.c
compiling dln_find.c
compiling encoding.c
encoding.c:825:2: error: implicit declaration of function 'rb_str_change_terminator_length' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
rb_str_change_terminator_length(obj, oldtermlen, termlen);
^
1 error generated.
make: *** [encoding.o] Error 1
!!! Compiling ruby 2.2.10 failed!
OS Version: 10.15.6
ruby-install version: 0.7.1
Any ideas on how to debug or fix this? I was previously able to install other versions of 2.2 before I upgraded my OS. I'm also able to install later versions like Ruby 2.7 with no problem
After a lot of breaking my head and realizing that the error has to do with the compilation using GCC that is native to macOS, I decided to do a test.
Because older versions of Ruby need instructions that are no longer present in updated make, it is necessary to download an older version of Command Line Tools for Xcode.
First, remove your actual version with:
sudo rm -rf /Library/Developer/CommandLineTools
Ignore the error about missing git.
Proceed to https://developer.apple.com/download/more/ and download 11.x version of Command Line Tools for Xcode.
I downloaded version 11.5 and it worked.
My return when running gcc -v
Configured with: --prefix = / Library / Developer / CommandLineTools / usr --with-gxx-include-dir = / Library / Developer / CommandLineTools / SDKs / MacOSX.sdk / usr / include / c ++ / 4.2.1
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: / Library / Developer / CommandLineTools / usr / bin
To compare, with recent Command Lines, 12.x, you'll see something like:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.2)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Apparently ignoring the compiler warning is also an option
export optflags="-Wno-error=implicit-function-declaration"
For further duscussion see Problem when installing Ruby 2.2.9 on Mac Big Sur M1
I was able to install that version on Mac 10.15.7 using rvm.
I have openssl#1.1 installed with homebrew. If you run brew info openssl what do you see? I would try brew upgrade openssl first.
Try running
export PKG_CONFIG_PATH="/usr/local/opt/openssl#1.1/lib/pkgconfig" with the info brew returns. Then try rvm install 2.2.10. If that doesn't work I would try rvm install 2.2.10 --with-openssl-dir=/usr/local/opt/openssl --with-openssl-lib=/usr/local/opt/openssl/lib --with-openssl-include=/usr/local/opt/openssl/include just make sure those paths are correct for your system.
You may also need to run
export LDFLAGS="-L/usr/local/opt/openssl#1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl#1.1/include"
beforehand, which will be supplied by brew info.
Adding some extra options here that might help:
We need the right SSL version:
$ brew install rbenv/tap/openssl#1.0
$ rvm install 2.2.10 -C --with-openssl-dir=`brew --prefix openssl#1.0`
First, install open-ssl
brew install rbenv/tap/openssl#1.0
Then
CFLAGS="-Wno-error=implicit-function-declaration" rvm reinstall ruby-2.2.5 --with-openssl-dir='/usr/local/opt/openssl#1.0'
I recently had to install ruby-2.2.0 in Catalina 10.15.7 and was facing the same issues. But luckily managed to get my work done. Steps are as follows:
Installed openssl as a rvm package:
$ rvm pkg install openssl
Ignored compiler warnings:
$ export optflags="-Wno-error=implicit-function-declaration"
Installed required ruby version (2.2.0 in my case) while providing openssl directory parameter and ignoring rubygems:
$ rvm install 2.2.0 --with-openssl-dir=$rvm_path/usr --rubygems ignore

Lektor installation fails on MacBookPro OS X 10.6.8

I am trying to install Lektor on a MacbookPro with OS X 10.6.8.
Imagemagick and Python2.7 are already installed.
When I run the installation command:
curl -sf https://www.getlektor.com/install.sh | sh
The build process runs until it gets an error when building '_watchdog_fsevents' extension. The error is:
cc1: error: -Werror=unused-command-line-argument-hard-error-in-future: No option -Wunused-command-line-argument-hard-error-in-future
I've cut and pasted the output just prior to the error into the following code section.
How should I overcome this?
running build_ext
building '_watchdog_fsevents' extension
creating build/temp.macosx-10.6-x86_64-2.7
creating build/temp.macosx-10.6-x86_64-2.7/src
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -Wno-error=unused-command-line-argument-hard-error-in-future -DWATCHDOG_VERSION_STRING="0.8.3" -DWATCHDOG_VERSION_MAJOR=0 -DWATCHDOG_VERSION_MINOR=8 -DWATCHDOG_VERSION_BUILD=3 -I/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/watchdog_fsevents.c -o build/temp.macosx-10.6-x86_64-2.7/src/watchdog_fsevents.o -std=c99 -pedantic -Wall -Wextra -fPIC -Wno-error=unused-command-line-argument-hard-error-in-future
cc1: error: -Werror=unused-command-line-argument-hard-error-in-future: No option -Wunused-command-line-argument-hard-error-in-future
cc1: error: -Werror=unused-command-line-argument-hard-error-in-future: No option -Wunused-command-line-argument-hard-error-in-future
error: command 'gcc-4.2' failed with exit status 1
----------------------------------------
Failed building wheel for watchdog
Failed to build watchdog
Most likely your version of OS X is too old to support the installation of watchdog with the version of gcc you have. If you cannot upgrade your OS X installation then I recommend installing a recent version of clang via brew and install lektor after exporting CC=clang.
Note though that Lektor is not tested for OS X < 10.9.
Your problem may be an updated version of Xcode in which you have not agreed to the license. Try running this first:
sudo xcodebuild -license
scroll to the very bottom and it will allow you to type "agree".
This resolved the issue for me.

Pandas Install Error on Mac

When I execute
sudo pip install pandas
I get the error:
creating build/temp.macosx-10.9-intel-2.7/pandas/src/datetime
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -Ipandas/src/klib -Ipandas/src -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pandas/index.c -o build/temp.macosx-10.9-intel-2.7/pandas/index.o
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1
I have installed xcode and xcode command line tools.
In fact, I can confirm that cc is installed by executing:
cc -v
which returns:
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
These flags ended up letting me install it:
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
and then (of course):
sudo -E pip install pandas
Thanks #user3378649 for the flags suggestion - that got me thinking along the right track!
Can you please these commands for more information.
As long as you didn't mention what you used to overcome this problem, I'd suggest different approaches to help narrow down in order to find the problem:
First Solution :
Run these flags :
export ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future"
if it doesn't work
run these flags :
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
Second Solution :
Get Homebrew - it's a one-line shell script to install!
Edit your .profile, or whatever is appropriate, and put /usr/local/bin at the start of -your PATH so that Homebrew binaries are found before system binaries
brew install python - this installs a newer version of python in /usr/local
run "pip install pandas"
Third Solution :
use easy_install.
Execute the following command in Terminal
PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:$(PATH)}"
export PATH
Then :
$ sudo easy_install pandas

Error while installing ruby-1.8.7 on Fedora 15

Using RVM, I tried to install ree-1.8.7-2011.03 after installing Fedora 15 and I get the following error. Using rvm install ree-1.8.7-2011.03 on Ubuntu 11.04 works fine..
Same error (and solution) with MRI ruby-1.8.7-p334 on Fedora 15.
Any ideas as to how to fix this?
make[1]: Entering directory `/home/ryguy/.rvm/src/ree-1.8.7-2011.03/source/ext/dl'
gcc -I/opt/local/include -I. -I/opt/local/include -I../.. -I../../. -I../.././ext/dl -DHAVE_DLFCN_H -DHAVE_DLOPEN -DHAVE_DLCLOSE -DHAVE_DLSYM -DHAVE_DLERROR -I. -fPIC -g -O2 -fno-defer-pop -fno-omit-frame-pointer -c ptr.c
gcc -I/opt/local/include -I. -I/opt/local/include -I../.. -I../../. -I../.././ext/dl -DHAVE_DLFCN_H -DHAVE_DLOPEN -DHAVE_DLCLOSE -DHAVE_DLSYM -DHAVE_DLERROR -I. -fPIC -g -O2 -fno-defer-pop -fno-omit-frame-pointer -c handle.c
Generating callback.func
Generating cbtable.func
gcc -I/opt/local/include -I. -I/opt/local/include -I../.. -I../../. -I../.././ext/dl -DHAVE_DLFCN_H -DHAVE_DLOPEN -DHAVE_DLCLOSE -DHAVE_DLSYM -DHAVE_DLERROR -I. -fPIC -g -O2 -fno-defer-pop -fno-omit-frame-pointer -c dl.c
In file included from dl.c:104:0:
callback.func:1:1: warning: data definition has no type or storage class [enabled by default]
callback.func:1:7: error: expected identifier or ‘(’ before ‘long’
In file included from dl.c:104:0:
callback.func:78:33: error: expected ‘)’ before ‘(’ token
callback.func:79:3: warning: data definition has no type or storage class [enabled by default]
callback.func:79:24: error: ‘proc’ undeclared here (not in a function)
callback.func:79:39: error: ‘argc’ undeclared here (not in a function)
callback.func:79:45: error: ‘argv’ undeclared here (not in a function)
callback.func:82:1: error: expected identifier or ‘(’ before ‘}’ token
dl.c:106:1: error: expected ‘;’, ‘,’ or ‘)’ before ‘static’
make[1]: *** [dl.o] Error 1
make[1]: Leaving directory `/home/ryguy/.rvm/src/ree-1.8.7-2011.03/source/ext/dl'
make: *** [all] Error 1
This also happens when installing ruby-1.8.7 with rvm in Fedora 15.
Reinier Balt's answer also works, in my case I had to install system wide ruby using yum.
Here's what I did:
cd ~/.rvm/src/ruby-1.8.7-p334/ext/dl
ruby mkcallback.rb > callback.func
ruby mkcbtable.rb > cbtable.func
I saw this too
I went into the src/ext/dl directory and manually generated callback.func and cbtable.func which are both incomplete. I had to do
rm callback.func
touch callback.func
ruby mkcallback.rb >> callback.func
(repeat for cbtable)
Somehow the simple ruby mkcallback.rb > callback.func did not work
then rerun rvm install 1.8.7 which will not overwrite your changes.
https://bugs.ruby-lang.org/issues/5108
[[tl;dr: see patch at bottom]]
I don't know why this happens, but it appears that the redirection to the file doesn't completely redirect the output. As a temporary hack/fix, that does get it working, you can pipe it through tee. It gets the job done, but is certainly not the proper solution.
Patch:
https://gist.github.com/1083163
This patch when applied like so: rvm install --patch /path/to/Fedora-15-ruby-1.8.7-p352.patch%0 ruby-1.8.7 will work. I will test it with ree as well and update.
EDIT: This same patch also works with ree.
rvm install --patch /path/to/Fedora-15-ruby-1.8.76-p352.patch%0 ree successfully installed a working ree for me.
patch from user865548 is now available in RVM (will be 1.9.1 or just rvm get head)

Resources