0

I can't seem to be get Ruby installed on my Mac. These are the steps I've taken so far:

  1. Downloaded the package from Ruby's site (http://www.ruby-lang.org/en/downloads/)
  2. Unpacked it running { tar xzvf ruby-1.9.1-p376.tar.gz }
  3. Went into the new ruby folder, and configured using {./configure}

This is where the error happens. When I run the configure, it gives me the error:

/usr/local/include/fuse/fuse_common.h:32:2: error: #error Please add -D_FILE_OFFSET_BITS=64 to your compile flags!
In file included from /usr/local/include/fuse/fuse.h:857,
                 from <command-line>:0:
/usr/local/include/fuse/fuse_compat.h:69:24: error: sys/statfs.h: No such file or directory

As a result, I can't make the package nor install it. I have no idea what is wrong. Any help is greatly appreciated. Thanks!

Bibhas Debnath
  • 14,559
  • 17
  • 68
  • 96
funkymunky
  • 1,811
  • 3
  • 20
  • 22
  • Which version did you download? Your title says 1.9.1, your tar command says 1.8.7. In either case they both should build without a problem (I'm on 10.6 too) – Marc-André Lafortune Jan 26 '10 at 23:48
  • I downloaded ruby-1.9.1. That was a typo up there sorry – funkymunky Jan 26 '10 at 23:59
  • The problem is still there; it's the configure that's giving me problems – funkymunky Jan 27 '10 at 00:05
  • 1
    That's very weird. fuse*.h are files to do with MacFUSE (file system in user space, for NTFS et al., drivers). I can't see Ruby having anything to do with those files at all. I'd advise trying macports or fink since the hard work is already done for you there. – Chinmay Kanchi Jan 27 '10 at 01:13
  • ++Chinmay: And they will grab the needed dependencies which i think is a big part of your problem. – prodigitalson Jan 27 '10 at 15:07

5 Answers5

3

Have you tried RVM? It lets you manage multiple versions of ruby and will take of installing them and managing any gem versions for you. It's pretty magic!

After you've installed it all you need to do is:

`rvm install 1.9`

Done!

jonnii
  • 28,019
  • 8
  • 80
  • 108
  • I second this. It makes managing *multiple* ruby's much easier. Wayne Seguin has done a brilliant job, and is very responsive in irb (#rvm on freenode). – Jamie van Dyke Jan 27 '10 at 01:02
  • Ok tried using RVM, but some problems with that as well. I followed the directions on RVM's website, and ran gem install rvm. After that, though, I can't seem to run the command 'rvm install 1.9.1'. It either says it doesn't know the "rvm" command or there's an error with 'make'. I've used 'make' just fine before, so not sure what the problem is. – funkymunky Jan 27 '10 at 01:11
  • You may need to use rvm-install first to set up paths, etc. – Dave Bacher Jan 27 '10 at 19:10
2

If the last line of configure output is

config.status: creating Makefile

then you have a makefile and you can try building it.

I got the fuse.h error, and just ran make to build a working ruby:

[neilk@maczombie ~]$ ruby --version
ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-darwin10.2.0]
nedski
  • 116
  • 1
  • this is the easiest answer - fuse support only matters if you want to use or build fuse filesystems... – Asher Aug 22 '10 at 12:12
1

Looks like others have run into this issue.

If you want need the binary, you could try rubyosx.

I guessing that the issue is that you have FUSE (or MacFUSE) installed in /usr/local and for whatever reason, the configure phase is doing something that's including it. If you're not trying to build ruby with some local extensions, but you want to build ruby yourself, try moving aside /usr/local (at least temporarily).

sudo mv /usr/local /usr/local.aside

(Beware, randomly messing with /usr and /usr/local directories can lead to trouble.)

Dave Bacher
  • 15,652
  • 3
  • 63
  • 86
  • This makes sense. I've uninstalled MacFUSE and now the previous error message about 'include/fuse' is gone. However, the configure still has errors saying it can't find libxml/tree.h and libxml/xpath.h. If I go ahead with the make anyway, it returns the following error: {readline.c:1159: error: ‘username_completion_function’ undeclared (first use in this function) readline.c:1159: error: (Each undeclared identifier is reported only once readline.c:1159: error: for each function it appears in.) make[1]: *** [readline.o] Error 1 make: *** [mkmain.sh] Error 1} – funkymunky Jan 27 '10 at 02:55
  • you need to compile and install libxml as well or provide the path to libxml when you run `configure` - probably something like `./configure --with-libxml=/path/to/libxml` but im not sure as its been a couple years since i manually compiled ruby. – prodigitalson Jan 27 '10 at 15:05
  • This is getting ugly. Unless you're really eager to learn about building software and all dependencies. I'd recommend going with a pre-built package from rubyosx, or using a real packaging system like fink or macports (as suggested by others). – Dave Bacher Jan 27 '10 at 19:08
0

What happens if you set C_Flags or CPP_Flags before doing your ./configure?

JT.
  • 31
  • 1
  • Sorry I'm pretty new at this, but what do those mean? I tried running the following command from a Ruby-installation tutorial, but got another error: {./configure --enable-shared --enable-pthread CFLAGS=-D_XOPEN_SOURCE=1} // ERROR: {readline.c:1159: error: ‘username_completion_function’ undeclared (first use in this function) readline.c:1159: error: (Each undeclared identifier is reported only once readline.c:1159: error: for each function it appears in.) make[1]: *** [readline.o] Error 1 make: *** [mkmain.sh] Error 1} // Are there other C_Flags I can use to configure? – funkymunky Jan 27 '10 at 00:21
  • isn't it C_FLAGS? not CFLAGS=? – JT. Jan 27 '10 at 18:18
-2

This isnt ananswer so much as a suggested alternative... use macports :-)

prodigitalson
  • 60,050
  • 10
  • 100
  • 114
  • 1
    I used macports and ran 'Sudo port install ruby19 +nosuffix'. Everything works now, though I still couldn't get RVM to work. I'll have to figure that out later. Thanks for all the help guys I really appreciate it – funkymunky Jan 28 '10 at 19:53
  • make sure your path is properly configured to use the gem installer/ruby in `/opt/local` as opposed to the system. It should auto configure this for you but ive found with some ports it fails to take effect (probably because they arent directly in bin or sbin but have their own tree - eg. apache2, mysql, etc.). as long as `/opt/local/bin` and `/opt/local/sbin` are on your path before anywhere else you should be ok though. – prodigitalson Jan 28 '10 at 20:06
  • open `~/.bash_profile` in a text editor and look for `export PATH=` followed by a series of paths separated by `:`. If `/opt/local/bin` and `/opt/local/sbin` arent at the front of that path add them like `export PATH=/opt/local/bin:/opt/local/sbin:/any/other/path/currently/here:$PATH` You might want to open a new question about "Shell Profiles" for more info. Or just Google it. – prodigitalson Jan 29 '10 at 04:25