0

I swear, I have seen all the discussions of installing Ruby on stackoverflow...NOTHING helped. I have Xcode 4.1 installed as well as rvm 1.16.19.

libksba is installed.

There's SOME version of Ruby installed somehow but I don't know which version -- because if I execute ANY kind of Ruby command -- "ruby" by itself, "ruby --version," whatever, I get no response, and to get a prompt I have to ctrl/c.

Using RVM or not, whenever I try to install ANY version of Ruby, I get this output:

Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include -L/Users/Dauber/.rvm/usr/lib ./configure --enable-shared --disable-install-doc --prefix=/Users/Dauber/.rvm/rubies/ruby-1.9.3-p286', please read /Users/Dauber/.rvm/log/ruby-1.9.3-p286/configure.log
There has been an error while running configure. Halting the installation.
ruby-1.9.3-p286 is not installed.

Here's the output from the aforementioned configure.log:

[2012-11-08 20:46:41] env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include -L/Users/Dauber/.rvm/usr/lib ./configure --enable-shared --disable-install-doc --prefix=/Users/Dauber/.rvm/rubies/ruby-1.9.3-p286 --with-gcc=clang
checking build system type... x86_64-apple-darwin11.4.2
checking host system type... x86_64-apple-darwin11.4.2
checking target system type... x86_64-apple-darwin11.4.2
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.

Now, a weird thing is that there's no file ANYWHERE in the system called "config.log," so I can't "see" it "for more details."

Another weird thing...I've compiled dozens of C programs on this machine using gcc and gcc-4.2 -- and I just tried AGAIN and they work fine, so I don't know exactly what the deal is there...

I've tried installing from https://github.com/kennethreitz/osx-gcc-installer to no avail; it made absolutely no difference.

This is all on my MacBook, running OSX 10.7.5. What's weird is...I've had ZERO problems on my iMac running the exact same version of Lion...in fact, I didn't even NEED to install Ruby - it happened to have 1.9.2 already on it; I just needed to add Rails and all worked perfectly...what the heck is so different that I can't get this stuff working on my MacBook???

AFTER PRUSSWAN'S LINK: Long story short, the other post prusswan linked to mentioned that there's a bug in the Rails installer and that /etc/rvmrc needed to be changed. I made the changes but got the exact same error message as before when I tried to install ruby. This is what configure.log says now, though:

[2012-11-08 22:42:08] env LDFLAGS=-L/opt/sm/pkg/active/lib -L/Users/Dauber/.rvm/usr/lib CFLAGS=-I/opt/sm/pkg/active/include -I/Users/Dauber/.rvm/usr/include CPATH=/opt/sm/pkg/active/include ./configure --enable-shared --disable-install-doc --prefix=/Users/Dauber/.rvm/rubies/ruby-1.9.3-p286
current path: /Users/Dauber/.rvm/src/ruby-1.9.3-p286
command(8): env LDFLAGS=-L/opt/sm/pkg/active/lib -L/Users/Dauber/.rvm/usr/lib CFLAGS=-I/opt/sm/pkg/active/include -I/Users/Dauber/.rvm/usr/include CPATH=/opt/sm/pkg/active/include ./configure --enable-shared --disable-install-doc --prefix=/Users/Dauber/.rvm/rubies/ruby-1.9.3-p286
checking build system type... x86_64-apple-darwin11.4.2
checking host system type... x86_64-apple-darwin11.4.2
checking target system type... x86_64-apple-darwin11.4.2
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc-4.2 accepts -g... yes
checking for gcc-4.2 option to accept ISO C89... none needed
checking whether we are using the GNU C++ compiler... yes
checking whether g++-4.2 accepts -g... yes
checking how to run the C preprocessor... gcc-4.2 -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking whether gcc-4.2 needs -traditional... no
checking whether the linker is GNU ld... no
checking whether gcc-4.2 -E accepts -o... yes
checking for real target cpu... x86_64
checking for ranlib... ranlib
checking for ar... ar
checking for as... as
checking for objdump... no
checking for gobjdump... no
checking for objcopy... no
checking for gobjcopy... no
checking for nm... nm
checking whether ln -s works... yes
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for a thread-safe mkdir -p...  -d
use 'mkdir -p' as MKDIR_P
checking for dot... no
checking for doxygen... no
checking for pkg-config... pkg-config
checking for AIX... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for cd using physical directory... cd -P
checking whether -Wno-unused-parameter is accepted... yes
checking whether -Wno-parentheses is accepted... yes
checking whether -Wno-long-long is accepted... yes
checking whether -Wno-missing-field-initializers is accepted... yes
checking whether -Werror=pointer-arith is accepted... yes
checking whether -Werror=write-strings is accepted... yes
checking whether -Werror=declaration-after-statement is accepted... yes
checking whether -Werror=shorten-64-to-32 is accepted... yes
checking whether -Werror=implicit-function-declaration is accepted... yes
checking whether -Wall -Wextra is accepted... yes
checking whether -ggdb is accepted... yes
checking whether -fvisibility=hidden is accepted... yes
checking whether -Wl,-unexported_symbol,_Init_* is accepted... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for _LARGE_FILES value needed for large files... no
checking whether byte ordering is bigendian... no
checking for an ANSI C-conforming const... yes
checking whether char is unsigned... no
checking for inline... inline
checking for working volatile... yes
checking for long long... yes
checking for off_t... yes
checking char bit... ./configure: line 8508: syntax error near unexpected token `rb_cv_char_bit,'
./configure: line 8508: `    AC_COMPUTE_INT(rb_cv_char_bit, CHAR_BIT,'

So it looks like the ./configure file that's generated generates with a typo or something...

ScatteredFrog
  • 71
  • 4
  • 9
  • It tells you to read "/Users/Dauber/.rvm/log/ruby-1.9.3-p286/configure.log", did you? At least post it here. – Andrew Marshall Nov 09 '12 at 03:13
  • Andrew -- just added it. – ScatteredFrog Nov 09 '12 at 03:24
  • try using Ruby 1.9.3-p194 instead (`rvm use 1.9.3-p194`). p286 was only out very recently so there might be hiccups. Another possibility is to upgrade your xcode version – prusswan Nov 09 '12 at 03:37
  • prusswan-- I can't use Ruby 1.9.3-p194 because it won't let me install it; it gives me the same error. Tried Xcode 4.1 and 4.5.2, same results. – ScatteredFrog Nov 09 '12 at 03:45
  • related: http://stackoverflow.com/questions/12928581/problems-installing-ruby-on-mountain-lion-ruby-1-9-3-wont-compile – prusswan Nov 09 '12 at 04:14
  • prusswan -- thanks....I corrected what they said was a bug, but it still didn't work. I'll add what I got in my original post. – ScatteredFrog Nov 09 '12 at 04:47

2 Answers2

0

Follow this guide which covers how to set up Ruby using RVM.

Ryan Bigg
  • 106,965
  • 23
  • 235
  • 261
  • I can't. Please re-read my post, specifically the part that says the "ruby" command doesn't work. The guide wants me to install homebrew, which I cannot with a nonworking "ruby" command. – ScatteredFrog Nov 09 '12 at 03:17
  • Well..I take it back...I WAS able to get both git and rvm installed, but following the instructions just gives me the same problems. – ScatteredFrog Nov 09 '12 at 03:27
  • No, I already HAVE RVM installed, it's Homebrew that I don't have installed because of the "ruby" command. – ScatteredFrog Nov 09 '12 at 04:04
0

Wow...I can't believe it, but I found the answer to my own question, and it was very DUH.

I should have used the "rvm remove" command -- tried that, and suddenly like magic I can now install any and all versions of Ruby to my heart's content.

Now to see if Aptana will let me create a new Rails project. :)

Thanks for the feedback, all...

ScatteredFrog
  • 71
  • 4
  • 9