Update: There is an updated version of this article for Snow Leopard here »
These are instructions for compiling and installing Ruby, Rubygems, Ruby on Rails, and Mongrel on Mac OS X 10.5 (Leopard).
If you already know why I write these tutorials, if you already have /usr/local in your path, if you’ve installed XCode installed already … in other words, if you’re an old-school Hivelogic reader, just click here to jump right to the instructions.
The FAQ (Sort Of)
Below I’ll walk you through getting your system ready for building and compiling open source software. But before I do, please allow me to answer of few of the questions I invariably get asked every time I release this type of do-it-yourself tutorials:
Why would I want to compile this stuff when it ships as part of Leopard?
Good question! Leopard ships with Ruby 1.8.6 and Rails 1.2.3 – both respectably recent and stable versions. And it’s easy enough to update to the latest version of Rails with a single command (sudo gem install rails if you’re curious).
Then why roll your own? I expand on the benefits of building your own open source utilities (like Ruby and Rails) and why where they live is important in my article entitled Using /usr/local, but here are a few of the reasons:
- You want to run the latest/greatest versions of available software and don’t want to wait (or hope) for Apple to release an update.
- Your want to update, tweak, and customize your own tools while keeping your system “stock” from Apple’s standpoint.
- Apple may decide to modify these utilities during a system update, and doing so may break your stuff.
- You can move or remove the
/usr/localfilesystem, or even transfer it to another machine in one step. - You’re used to, interested in, or curious about in the compile and build process.
For some people, these reasons are enough to take a few minutes to build your own software.
Why wouldn’t I just use MacPorts or Fink?
Both MacPorts and Fink are great projects, and I wholeheartedly support their efforts. I’m also a longtime FreeBSD geek, and the FreeBSD ports tree is something I’ve relied upon for ages. So I really get what MacPorts and Fink are about.
On the other hand, I’m a geek at heart, I don’t mind compiling my own software, and I like the ability to build just what I need, right when I need it, without installing or waiting for any additional or externally-maintained software. If this method sounds like a headache to you, I know where you’re coming from. MacPorts and Fink provide most excellent alternatives. Tell them I sent you.
I used your instructions and I got the following error …
Please don’t email me about it but instead, post your question in the comments. I try and read and respond as often as I can. When I can’t, other Hivelogic readers often step in and try to help (they’re a great bunch), and usually we can figure it out together.
Prerequisites
You will need:
- Mac OS X 10.5 (Leopard)
- Xcode 3.0 or newer
- Familiarity with (or willingness to use) the Mac OS X Terminal application
Note: You will probably need to install Xcode from the Mac OS X install DVD/CD (in the Optional Installs → Xcode folder). You can also download it from Apple’s Developer Connection free of charge.
Another Note: These instructions are written for people using the default Mac OS X shell, bash. If you haven’t manually changed your shell from bash, and you didn’t upgrade to Leopard from something older than Tiger, then you don’t have anything to worry about. If you’ve taken specific steps to change the default shell to something other than bash (like tcsh), then you’ll need to figure out equivalent syntax to use when setting paths and environment variables, or just switch back to bash, because we just roll with bash here. Sorry.
Just In Case
While it’s unlikely that any of these steps might damage your system somehow, it’s probably a good idea to have a current backup of everything, just in case (I recommend SuperDuper! for this by the way, awesome product). So you’re following these instructions at your own risk, and I’m not liable for anything that happens.
A Note about sudo
With great power comes great responsibility, so Mac OS X may prompt you for your password prior to executing some of the commands you’ll be typing. It may do this only once, or several times throughout this process. Just re-enter your password as needed.
Using Terminal
You’ll need to launch the Terminal application. It can be found in the /Applications/Utilities folder.
Each of the lines below appearing in monospaced type should be entered into Terminal, and be followed by the Return key.
Paths
Don’t skip this step!
Mac OS X, like other UNIX systems, uses something called a path to determine where it should look for applications on the command line (that is, when you’re using the Terminal app). The path is actually an environment variable, set by a special file that’s automatically executed when you open a new Terminal window.
We need to make sure that our path is set to look for files in /usr/local (the place where we’ll be installing the tools) before looking anywhere else. This is important.
To see if the path has been set properly, we can check the contents of the .profile file (the special file hidden in our home folder) for a PATH line using a text editor. TextMate, TextWrangler, BBEdit, and vi are all perfectly good options. To open the file with TextMate, for example, we can type:
mate ~/.profile
This will open the file if it already exists, or open a blank file if it doesn’t. Add the following line at the very end of the file:
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
Now save and close the file.
It doesn’t matter how many other lines there are in the file, or what they say or do. Just make sure that this line comes last and you should be fine.
To make sure the changes are picked up correctly, we now need to execute the file with the following command:
. ~/.profile
It’s likely there will be no response from the shell here, just the prompt, but that’s OK, the changes have been picked up and we’re ready to move on.
You can also close your Terminal and open a new one instead if you’d like.
Note: You may have noticed that I’ve added MySQL to the path in the line above. That’s because most users will be installing MySQL later in this tutorial. If you’re the type to want to use something like SQLite or PostGreSQL as your database instead of MySQL, you can feel free to omit the /usr/local/mysql/bin: bit from the line above, and replace it with the path to the database of your choice. If this note doesn’t make sense to you, even if you don’t plan to install MySQL later, just keep on going … the extra bit in the path statement won’t affect you at all.
Setting Up
I like to create a folder to contain all of the downloaded files and their respective build folders. I tend to keep this folder around indefinitely. Source code doesn’t take up much space, and it’s useful to refer back to later to remind yourself of previous installation details or techniques, installed versions, for a fast install at a later time, or in case you want to uninstall something.
For these examples, we’ll create a folder called src in the /usr/local section of the filesystem, and change directories into that folder. It will be our workspace for everything we do here:
sudo mkdir -p /usr/local/src sudo chgrp admin /usr/local/src sudo chmod -R 775 /usr/local/src cd /usr/local/src
You’ll download and compile everything in this new folder.
Ruby
Ok, let’s get started. Unlike previous versions of Mac OS X, Leopard has everything you’ll need to compile Ruby. You don’t need to install any prerequisites. Take these commands and type or paste them into Terminal:
curl -O ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.tar.gz tar xzvf ruby-1.8.7-p72.tar.gz cd ruby-1.8.7-p72 ./configure --enable-shared --enable-pthread CFLAGS=-D_XOPEN_SOURCE=1 make sudo make install cd ..
To verify that Ruby is installed and in your path, just type:
which ruby
You should see:
/usr/local/bin/ruby
If you don’t, you haven’t set your path correctly.
RubyGems
With Ruby installed, we can move on to RubyGems. Same routine:
curl -O http://rubyforge.iasi.roedu.net/files/rubygems/rubygems-1.3.1.tgz tar xzvf rubygems-1.3.1.tgz cd rubygems-1.3.1 sudo /usr/local/bin/ruby setup.rb cd ..
Ruby on Rails
At last, we’re ready to install Rails. RubyGems will handle this for us:
sudo gem install rails
Mongrel and Capistrano get installed the same way:
sudo gem install mongrel sudo gem install capistrano
There are a handful of other gems you’ll undoubtedly want, and you can install them one at a time, or all on one line (if you have a list) like this:
sudo gem install RedCloth termios rspec sake
The MySQL Gem
As of Rails 2.0, the default database system is is now SQLite, which also ships with Leopard.
Many of us still run MySQL locally though, and want to install the MySQL gem for better Rails integration. If you followed my MySQL for Mac OS X installation instructions or used one of the official MySQL distributions, your MySQL lives in /usr/local/mysql. You can install the gem using the following command:
sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
We’re Done
Congratulations, you now have a custom-built, properly installed Ruby on Rails system! You might also like to build your own Subversion client or run your own MySQL server too.






Ben Reubenstein
28 February 2008 at 12:26 pm
Great update to an old classic. Thx Dan.
Meagan Fisher
28 February 2008 at 1:20 pm
Another tutorial is written, another round of stalkers is born.
Grant Hutchinson
28 February 2008 at 1:40 pm
Thank you from the bottom of my /Developer directory.
Steven Hoy
28 February 2008 at 2:05 pm
Thank You - I appreciate the effort you put into these things… S.
Jared Burns
28 February 2008 at 2:17 pm
Awesome! As always, thanks for the step-by-step.
Tanner Christensen
28 February 2008 at 2:49 pm
About time Dan!
Only joking. Thanks for getting this up, it’s greatly apprecaited.
markus
28 February 2008 at 3:22 pm
heya
Why the ugly path? Why not use Gobolinux instead? :-)
No need to fill up the PATH var at all
Jon Buda
28 February 2008 at 3:55 pm
Great! Thanks for the hard work, been waiting for this. Things are a bit haywire after the upgrade from 10.4 to 10.5. I should probably just do a clean install…
Jon
28 February 2008 at 4:48 pm
mySQL does not seem to be communicating properly. every time I try to enter mysql -uroot it always comes back with command not found. where am I going wrong?
Dan Benjamin
28 February 2008 at 6:09 pm
@camiloAndres - looks like you haven’t installed Xcode, so it can’t find a compiler.
@Jon - sounds like you don’t have MySQL in your path, or don’t have it installed. Check out the MySQL tutorial.
Brandon Kelly
28 February 2008 at 7:53 pm
Thanks Dan!! I had begun to think you were never going to get around to this. Much appriciated!
Pete Yandell
29 February 2008 at 5:06 pm
For those who prefer the much simpler process of using MacPorts to install all this stuff, I’ve got a guide here:
Install MySQL, Ruby, Rails, and Mongrel with MacPorts
Greg
29 February 2008 at 11:00 pm
Excellent article. I found that I needed to use the command ‘sudo gem install mysql——with-mysql-config=/usr/local/mysql/bin/mysql_config’ to get the MySQL binding gem to install. gem always complained about not being able to find the mysqlclient library. Oh, and thanks for the launchd script on your MySQL tutorial page!
Keam
01 March 2008 at 10:41 am
Great lesson!
You think you can do a tutorial on installing Mysql + PHP + phpmyadmin ?
would definitely be helpful.
Thank you!
Steve Moore
02 March 2008 at 5:02 pm
Dan, thanks for another great tutorial! I plan on using usr/local for installing ruby/rails/mysql on my laptop, but where would you recommend these be installed in a production server? I ask because I set up my old powermac as a server, and am just beginning to play around with that kind of thing. Thanks again for the help!
Christopher Ricca
03 March 2008 at 10:45 am
The world seems somehow more in order with this post in existence: balance has been restored. Thanks!
Carole Carter
03 March 2008 at 6:57 pm
Thank you for this. I am wondering about the Apple Developer Tools. I installed them as required. What I wonder about is what I can now delete from my hard drive. In other words, there are lots of things included that I don’t think I need and I have a small hard drive. Can I safely delete things in the Developer Directory such as the Documentation, Examples, etc?
Thank you and I appreciate this post. I really helps.
Bala Paranj
03 March 2008 at 9:27 pm
./configure—enable-shared—enable-pthread CFLAGS=-D_XOPEN_SOURCE=1
fails with the following error message in config.log. Can someone please help? TIA.
> ruby-1.8.6-p111 balaparanj$ cat config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ ./configure—enable-shared—enable-pthread CFLAGS=-D_XOPEN_SOURCE=1
##————- ##
## Platform. ##
##————- ##
hostname = bala-paranjs-computer.local
uname -m = i386
uname -r = 9.2.0
uname -s = Darwin
uname -v = Darwin Kernel Version 9.2.0: Tue Feb 5 16:13:22 PST 2008; root:xnu-1228.3.13~1/RELEASE_I386
/usr/bin/uname -p = i386
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = Mach kernel version:
Darwin Kernel Version 9.2.0: Tue Feb 5 16:13:22 PST 2008; root:xnu-1228.3.13~1/RELEASE_I386
Kernel configured for up to 2 processors.
2 processors are physically available.
2 processors are logically available.
Processor type: i486 (Intel 80486)
Processors active: 0 1
Primary memory available: 4.00 gigabytes
Default processor set: 62 tasks, 235 threads, 2 processors
Load average: 0.57, Mach factor: 1.42
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /usr/local/bin
PATH: /usr/local/sbin
PATH: /usr/local/mysql/bin
PATH: /sw/bin
PATH: /sw/sbin
PATH: /Users/balaparanj/bin
PATH: /opt/local/bin
PATH: /opt/local/sbin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/local/bin
PATH: /usr/X11/bin
PATH: /usr/X11R6/bin
##—————- ##
## Core tests. ##
##—————- ##
configure:1892: checking build system type
configure:1910: result: i686-apple-darwin9.2.0
configure:1932: checking host system type
configure:1947: result: i686-apple-darwin9.2.0
configure:1969: checking target system type
configure:1984: result: i686-apple-darwin9.2.0
configure:2245: checking for gcc
configure:2261: found /usr/bin/gcc
configure:2272: result: gcc
configure:2510: checking for C compiler version
configure:2517: gcc—version >&5
i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2520: $? = 0
configure:2527: gcc -v >&5
Using built-in specs.
Target: i686-apple-darwin8
Configured with: /private/var/tmp/gcc/gcc-5367.obj~1/src/configure—disable-checking -enable-werror—prefix=/usr—mandir=/share/man—enable-languages=c,objc,c++,obj-c++—program-transform-name=/^[cg][^.-]*$/s/$/-4.0/—with-gxx-include-dir=/include/c++/4.0.0—with-slibdir=/usr/lib—build=powerpc-apple-darwin8—with-arch=nocona—with-tune=generic—program-prefix=—host=i686-apple-darwin8—target=i686-apple-darwin8
Thread model: posix
gcc version 4.0.1 (Apple Computer, Inc. build 5367)
configure:2530: $? = 0
configure:2537: gcc -V >&5
gcc: argument to `-V’ is missing
configure:2540: $? = 1
configure:2563: checking for C compiler default output file name
configure:2590: gcc -D_XOPEN_SOURCE=1 conftest.c >&5
/usr/bin/ld: /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../libSystem.dylib unknown flags (type) of section 6 (__TEXT,__literal16) in load command 0
collect2: ld returned 1 exit status
configure:2593: $? = 1
configure:2631: result:
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME “”
| #define PACKAGE_TARNAME “”
| #define PACKAGE_VERSION “”
| #define PACKAGE_STRING “”
| #define PACKAGE_BUGREPORT “”
| #define USE_BUILTIN_FRAME_ADDRESS 1
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2638: error: C compiler cannot create executables
See `config.log’ for more details.
##————————##
## Cache variables. ##
##————————##
ac_cv_build=i686-apple-darwin9.2.0
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value=-D_XOPEN_SOURCE=1
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_YACC_set=
ac_cv_env_YACC_value=
ac_cv_env_YFLAGS_set=
ac_cv_env_YFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=i686-apple-darwin9.2.0
ac_cv_prog_ac_ct_CC=gcc
ac_cv_target=i686-apple-darwin9.2.0
##————————- ##
## Output variables. ##
##————————- ##
ALLOCA=’‘
AR=’‘
ARCHFILE=’‘
ARCH_FLAG=’‘
AS=’‘
ASFLAGS=’‘
CC=‘gcc’
CCDLFLAGS=’‘
CFLAGS=’-D_XOPEN_SOURCE=1’
COMMON_HEADERS=’‘
COMMON_LIBS=’‘
COMMON_MACROS=’‘
CP=’‘
CPP=’‘
CPPFLAGS=’‘
CPPOUTFILE=’‘
DEFS=’‘
DLDFLAGS=’‘
DLDLIBS=’‘
DLEXT2=’‘
DLEXT=’‘
DLLWRAP=’‘
ECHO_C=‘ECHO_N=’‘
ECHO_T=’‘
EGREP=’‘
ENABLE_SHARED=’‘
EXEEXT=’‘
EXPORT_PREFIX=’‘
EXTOUT=’‘
EXTSTATIC=’‘
GNU_LD=’‘
GREP=’‘
INSTALL_DATA=’‘
INSTALL_PROGRAM=’‘
INSTALL_SCRIPT=’‘
LDFLAGS=’‘
LDSHARED=’‘
LIBEXT=’‘
LIBOBJS=’‘
LIBPATHENV=’‘
LIBPATHFLAG=’‘
LIBRUBY=’‘
LIBRUBYARG=’‘
LIBRUBYARG_SHARED=’‘
LIBRUBYARG_STATIC=’‘
LIBRUBY_A=’‘
LIBRUBY_ALIASES=’‘
LIBRUBY_DLDFLAGS=’‘
LIBRUBY_LDSHARED=’‘
LIBRUBY_SO=’‘
LIBS=’‘
LINK_SO=’‘
LN_S=’‘
LTLIBOBJS=’‘
MAINLIBS=’‘
MAJOR=‘1’
MAKEDIRS=’‘
MAKEFILES=’‘
MANTYPE=’‘
MINIOBJS=’‘
MINIRUBY=’‘
MINOR=‘8’
NM=’‘
NROFF=’‘
OBJDUMP=’‘
OBJEXT=’‘
OUTFLAG=’‘
PACKAGE_BUGREPORT=’‘
PACKAGE_NAME=’‘
PACKAGE_STRING=’‘
PACKAGE_TARNAME=’‘
PACKAGE_VERSION=’‘
PATH_SEPARATOR=’:’
PREP=’‘
RANLIB=’‘
RDOCTARGET=’‘
RM=’‘
RPATHFLAG=’‘
RUBYW_INSTALL_NAME=’‘
RUBY_INSTALL_NAME=’‘
RUBY_SO_NAME=’‘
RUNRUBY=’‘
SET_MAKE=’‘
SHELL=’/bin/sh’
SOLIBS=’‘
STATIC=’‘
STRIP=’‘
TEENY=‘6’
TRY_LINK=’‘
WINDRES=’‘
XCFLAGS=’‘
XLDFLAGS=’‘
YACC=’‘
YFLAGS=’‘
ac_ct_CC=‘gcc’
arch=’‘
bindir=’${exec_prefix}/bin’
build=‘i686-apple-darwin9.2.0’
build_alias=’‘
build_cpu=‘i686’
build_os=‘darwin9.2.0’
build_vendor=‘apple’
configure_args=’‘
datadir=’${datarootdir}’
datarootdir=’${prefix}/share’
docdir=’${datarootdir}/doc/${PACKAGE}’
dvidir=’${docdir}’
exec_prefix=‘NONE’
host=‘i686-apple-darwin9.2.0’
host_alias=’‘
host_cpu=‘i686’
host_os=‘darwin9.2.0’
host_vendor=‘apple’
htmldir=’${docdir}’
includedir=’${prefix}/include’
infodir=’${datarootdir}/info’
libdir=’${exec_prefix}/lib’
libexecdir=’${exec_prefix}/libexec’
localedir=’${datarootdir}/locale’
localstatedir=’${prefix}/var’
mandir=’${datarootdir}/man’
oldincludedir=’/usr/include’
pdfdir=’${docdir}’
prefix=‘NONE’
program_transform_name=‘s&^&&’
psdir=’${docdir}’
rubyw_install_name=’‘
sbindir=’${exec_prefix}/sbin’
setup=’‘
sharedstatedir=’${prefix}/com’
sitearch=’‘
sitedir=’‘
sysconfdir=’${prefix}/etc’
target=‘i686-apple-darwin9.2.0’
target_alias=’‘
target_cpu=‘i686’
target_os=‘darwin9.2.0’
target_vendor=‘apple’
##—————- ##
## confdefs.h. ##
##—————- ##
#define PACKAGE_NAME “”
#define PACKAGE_TARNAME “”
#define PACKAGE_VERSION “”
#define PACKAGE_STRING “”
#define PACKAGE_BUGREPORT “”
#define USE_BUILTIN_FRAME_ADDRESS 1
configure: exit 77
James Blachly
03 March 2008 at 11:57 pm
Greg,
your comment about needing to add—with-mysql-config=/usr/local/mysql/bin/mysql_config was just the ticket ! I was struggling to get the msyql bindings gem installed.
FWIW, I started with a stock 10.5 machine, installed Mysql 5 (arch x86-64) package from mysql.com, and then tried to install the mysql gem.
Looking at logs from before-and-after Greg’s solution, it appears that as someone else has already noted, it is a problem with the -arch flag passed to the compiler.
Now, why make or whatever cannot find mysql_config on its own, I have no idea. I suppose because I don’t have .../mysql/bin in my path, but you’d think it would know where to look for it.
Anyway, thanks again Greg.
James Blachly
04 March 2008 at 12:03 am
I take that back! /usr/local/mysql/bin WAS in my path, but for some reason the ruby configurator or makefile (not sure how the gem installation process works) was not even trying to run it, because it should have been found in my path.
Anyone else have this problem besides Greg and myself? Why would this be happening?
Bone stock 10.5 + Mysql single-arch package (x86_64 in my case).
Raphael Campardou
05 March 2008 at 2:02 pm
Typical.
I start wondering about getting ruby & all on my mac,
one afternoon I start wandering on google:
5 days earlier, you post this…
I call that perfect timing.
Thanx !
Mairon
05 March 2008 at 4:17 pm
Dan,
Thank you for the update.
It was hard for me to figure out the “Path” section because I’m a complete noob when it comes to programming. Perhaps you should edited in a way a 5 yr. old can follow it to make sure everybody gets it!
Matthew Bergman
06 March 2008 at 8:19 pm
Dan,
Your tutorials have been a lifesaver since I’ve begun my journey into rails. Amazing how simplified it become from 10.4 to 10.5. Really think you should addon how to install imagemagick and rmagick since that can always be a nightmare to a newbie. Even a link to the ruby installer script would probably help out a few people.
Justin Bell
07 March 2008 at 10:17 am
Hi. I was wondering what consequences there are for running a separate install like this. I’ve read that Leopard has Ruby integration into X-code for building Cocoa apps etc., and I’m also guessing there are some GUI features and default web server settings on Leopard Server that will be affected, too?
elliottcable
08 March 2008 at 3:28 pm
One more reason to build from source instead of using the default Mac OS X install - Unicode entry in IRb is broken in the Ruby.framework build that comes with Leopard.
Just go try to type ? (U+03BB) to create a new proc! kaboom.
So, yeah. Build your own, get proper Unicode support in embedded readline. It’s the way to go (-:
Daniela van der Heijden
10 March 2008 at 8:52 am
the mysql install didn’t work for me (MacBook, Leopard), kept getting:
dyld: Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib
Referenced from: /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle
Reason: image not found
the following (all in one line!) worked and got my db running again..:
sudo install_name_tool -change /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib /usr/local/mysql/lib/libmysqlclient.15.dylib /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle
Sean Y
10 March 2008 at 4:12 pm
Thanks so much! I’ve been looking forward to this tutorial
Christopher Ricca
13 March 2008 at 12:29 am
I got this running on one system great, but am running into an old friend of an error for irb/console:
dyld: NSLinkModule() error
dyld: Symbol not found: _rl_completion_matches
Referenced from: /usr/local/lib/ruby/1.8/powerpc-darwin9.2.0/readline.bundle
Expected in: flat namespace
Trace/BPT trap
This was back from when readline was an issue, but any ideas for how to tackle it now? Just wanted to throw the code out there to Google in case anyone else is running into this.
Leopard 10.5.2 PPC iMac
Imran Anwar
13 March 2008 at 1:12 am
What are your or other users’ experiences with using Bitnami’s installers i.e. rubystack ?
Imran
Matt Patterson
13 March 2008 at 4:50 am
@Christopher Ricca: Sounds like you didn’t use—enable-shared during the ./configure step - at least, i was getting those dyld errors when I missed that out before.
Matt Patterson
13 March 2008 at 4:58 am
Dan, I tried sudo make install-doc after sudo make install and got a Bus Error. A little bit of googling suggested this was due to problems with Leopard’s version of getcontext/setcontext. Laurent Sansonetti (Apple’s Ruby guy) suggests using the patch from http://chopine.be/lrz/ruby-osx-patches/ignore-gsetcontext.diff
(Thanks for such good instructions, btw)
Matt Patterson
13 March 2008 at 4:59 am
Sorry, I forgot to provide references, so here you go. Laurent suggests the patch: http://www.ruby-forum.com/topic/136252
Gawin
15 March 2008 at 8:21 am
Just curious, doesn’t this totally break the DTrace functionality in Ruby under OS X? Since 1.8.6 was especially patched to support DTrace and Apple’s Instruments.app (based on Joyent’s patches for Solaris).
http://trac.macosforge.org/projects/ruby/wiki/WhatsNewInLeopard
tim
16 March 2008 at 8:12 am
Two questions. Do I assume first that I need to install RubyGems and RoR in /usr/local/src, and Mysql as well?
Also, I was proceeding along fine with this until trying to install RubyGems then tar seems to suddenly have stopped working. Here is the terminal output.
DesktopImac:~ tim_mina$ cd /usr/local/src
DesktopImac:src tim_mina$ curl -O http://files.rubyforge.mmmultiworks.com/rubygems/rubygems-1.0.1.tgz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
39 240k 39 96896 0 0 38545 0 0:00:06 0:00:02 0:00:04 172k
100 240k 100 240k 0 0 77933 0 0:00:03 0:00:03—:—:— 202k
DesktopImac:src tim_mina$ tar xzvf rubygems-1.0.1.tgz
-bash: tar: command not found
DesktopImac:src tim_mina$
Any ideas - google has not helped so far
Seth
16 March 2008 at 1:49 pm
Hey—am brand new to ruby and having a bit of trouble with how RoR 2 works—I followed the instructions w/out a hitch both here and at your mysql install guide. However, my ruby server kept asking for the sqlite3 gem. I installed the gem, and it works fine now, but is it failing to default to mysql? Seemed odd it would do this after installing the mysql gem, unless there’s a switch somewhere that forces ruby to ignore sqlite. THX FOR THE GREAT TUTORIALS!!! MEGA KUDOS!
sc
newbee
17 March 2008 at 12:33 pm
My ruby make dies ugly with a seg. fault. Any ideas why? Thanks
newbee$ make
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c array.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c bignum.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c class.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c compar.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c dir.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c dln.c
dln.c: In function ‘dln_load’:
dln.c:1463: warning: ‘NSCreateObjectFileImageFromFile’ is deprecated (declared at /usr/include/mach-o/dyld.h:145)
dln.c:1469: warning: ‘NSLinkModule’ is deprecated (declared at /usr/include/mach-o/dyld.h:161)
dln.c:1472: warning: ‘NSIsSymbolNameDefined’ is deprecated (declared at /usr/include/mach-o/dyld.h:176)
dln.c:1475: warning: ‘NSAddressOfSymbol’ is deprecated (declared at /usr/include/mach-o/dyld.h:188)
dln.c:1475: warning: ‘NSLookupAndBindSymbol’ is deprecated (declared at /usr/include/mach-o/dyld.h:179)
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c enum.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c error.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c eval.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c file.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c gc.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c hash.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c inits.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c io.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c marshal.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c math.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c numeric.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c object.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c pack.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c parse.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c process.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c prec.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c random.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c range.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c re.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c regex.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c ruby.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c signal.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c sprintf.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c st.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c string.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c struct.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c time.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c util.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c variable.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c version.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c dmyext.c
ar rcu libruby-static.a array.o bignum.o class.o compar.o dir.o dln.o enum.o error.o eval.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o util.o variable.o version.o dmyext.o
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c main.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -c dmydln.c
gcc -D_OPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -L. main.o dmydln.o libruby-static.a -lpthread -ldl -lobjc -o miniruby
./mkconfig.rb:191: [BUG] Segmentation fault
ruby 1.8.6 (2007-09-24) [i686-darwin9.2.0]
make: *** [.rbconfig.time] Abort trap
Macintosh-2:ruby-1.8.6-p111 newbee$
Colby Wallace
20 March 2008 at 11:27 am
I have followed directions for setting up /usr/local/bin/ on my new MacBook but after i finish and get ready to set up Ruby, it says there is no such folder created. it is not creating the folder..i follow the directions step by step…any thoughts?
Duvandekoker
24 March 2008 at 5:46 am
As usual works great, thanks Dan… Easiest set of instructions to follow ever..
One question: After updating my rails, I came to realise that because I’m a huge noob I require the use of an older version of RoR. 1.2.6, this is only because I’m following a tutorial from Agile Web Development with Rails, and the book is written with Rails 1.2 and available gems 1.2.3.
How do I downgrade to the correct version? I am getting a bunch of errors because scaffolding is no longer available. The installation worked great and everything is working fine, and will obviously upgrade when I’m more comfortable with rails. Could anyone help me?? :(
Smitty
25 March 2008 at 2:03 pm
Trying to run ‘curl -O ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p111.tar.gz’ and I’m getting an error…curl: (23) Failed writing body. I’ve been successful until this point, is there something I’m missing? Thx
cyril godefroy
25 March 2008 at 2:26 pm
Another reason to build ruby and rails is that ruby paths are Mac specific when copies go some files such as dispatch.fcgi and this is evil. I have no /System/Library directory on ou deployment server. Having a /usr/local directory everywhere is much easier.
Alex Basson
25 March 2008 at 10:39 pm
I got here from Agile Web Development, and I very much appreciate the tutorial; thanks, Dan!
I followed the directions and everything installed just fine (I think). Fwiw, I had already installed MySQL from the official package distribution back when I was running Tiger, and it does indeed live in /usr/local/mysql, so I didn’t re-install it.
The problem is, I get the following error when trying out the “Hello World!” app in Chapter 4:
“no such file to load—sqlite3”
Furthermore, when I go to http://localhost:3000 (which loads just fine) and click on “About your application’s environment”, I get the same error.
I’m a total noob, but it seems to me as though Rails is trying to talk to Sqlite instead of MySQL. How do I fix this?
Any and all help much appreciated.
Alex Basson
25 March 2008 at 10:58 pm
Update: After some hunting around, I found a post which suggested I try creating the demo project by adding “-d mysql” to the “rails…” statement; in other words, typing:
“rails -d mysql demo”
So I did, after deleting the initial installation. Now I get a different error message:
“No such file or directory - /tmp/mysql.sock”
Again, all help is appreciated. Thanks in advance.
Duvandekoker
27 March 2008 at 1:12 am
ALEX BASSON follow this:
When setting up your ruby application you must advise the machine to use MySQL instead of SQLite3 which is your current system default (even though you might have MySQL installed)
rails demo—database=mysql and there you go!! Your app will be configured to point to mysql instead of sqlite.
Also in your config directory the database.yml generates the code according to which database its pointed to: just make sure that its something like this!!
# MySQL (default setup). Versions 4.1 and 5.0 are recommended.
# # Install the MySQL driver:
# gem install mysql
# On MacOS X:
# gem install mysql——include=/usr/local/lib
# On Windows:
# gem install mysql
# Choose the win32 build.
# Install MySQL and put its /bin directory on your path.
# # And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql
database: name_development
username: root
password: root
# Warning: The database defined as ‘test’ will be erased and
# re-generated from your development database when you run ‘rake’.
# Do not set this db to the same as development or production.
test:
adapter: mysql
database: name_test
username: root
password: root
production:
adapter: mysql
database: name_production
username: root
password:
It doesnt work to just change the code as the app you are creating is still pointed to the SQLite databases and blah blah!
Its just a simple step to be included right from the word go!!
So have fun!!
Duvandekoker
27 March 2008 at 8:44 am
Silly me, let me shed some light on the topic.
I myself struggled to install MySQL/Ruby and then to get everything working at 100%. Best practice is: to follow Dan’s installation process again, and re-install MySQL exactly how he has instructed you to do.
Then once your MySQL and Ruby environment is set up correctly. Create a ruby app: rails demo -and this will create all the directories and files that you will require. Here’s the trick, because ruby’s new default database is SQLite3, everything will be pointed to a SQLite3 database environment. If you go to config/database.yml you will see it as clear as daylight!! All the settings show this to be true!
To fix this create the app like so: rails demo –database=mysql this tells ruby to use another database. And if you now check the config/database.yml you’ll notice that all the settings are structured for MySQL and not SQLite3.
peace out
Bala Paranj
30 March 2008 at 5:50 pm
The default command in the article installs Rails 1.2.6. sudo gem install rails—include-dependencies will install the Rails 2.0.2 version.
The problem with my machine was due to upgrade to Leopard. I formatted the hard drive and installed Leopard. All the instructions work fine. Thanks Dan.
Todd K
30 March 2008 at 11:13 pm
So I have gotten most of this to work (Including the install of MySQL), but when I get to the part about installing the MySQL Gems, I get the following error:
Building native extensions. This could take a while…
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb install mysql——with-mysql-dir=/usr/local/mysql
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lm… yes
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lz… yes
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lsocket… no
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lnsl… no
checking for mysql_query() in -lmysqlclient… no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
A bunch of configuaration options ar ethen listed, followed by:
Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.out
Any help would be great. Thanks.
another rails developer
03 April 2008 at 3:21 am
Thanks, this is my fourth or fifth time to use hivelogic. As always, it saves me a ton of time!
Gavin
03 April 2008 at 12:38 pm
Hey. Firstly thanks for taking the time to post this tutorial I can’t wait to get to the end.
Secondly I’ve just installed ruby and checked to see if it is installed correctly by typing
which ruby
but what I get is
/usr/bin/ruby
and not
/usr/local/bin/ruby
am I doing something wrong?
Thanks
Adam
04 April 2008 at 2:48 pm
@Gavin: did you skip modifying the PATH variable in ~/.bash_login? /usr/local/bin needs to precede /usr/bin in the PATH, otherwise the default Mac OS X version will be found first.
Naveen
09 April 2008 at 6:37 am
I don’t recall if I read anything better than this in my life
VERY HELPFUL
Marty
11 April 2008 at 1:28 pm
I have a similar problem as Todd K. When I’m issue:
sudo gem install daemons gem_plugin mongrel mongrel_cluster—include-dependencies
I get this error (essentially, it can’t find the Ruby headers):
Building native extensions. This could take a while…
ERROR: Error installing mongrel_cluster:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install daemons gem_plugin mongrel mongrel_cluster—include-dependencies can’t find header files for ruby.
I have Xcode Tools installed. I’m sure this is a matter of pointing to the correct file(s), but I don’t know where to do that.
Thanks a million.
Luis Oscar Cruz
12 April 2008 at 9:15 pm
I noticed I installed Ruby and Rails to usr/bin; how may I move them to usr/local/bin?
Luis Oscar Cruz
13 April 2008 at 4:59 am
Ok, I did it.
We shouldn’t remove original ruby, gems and rails files on usr/bin ?
Edgar Schmidt
19 April 2008 at 6:02 pm
Hey! Thanks for the tutorial.
As soon as I finished this, I decided to try it by creating a generic app (testapp). After fixing a few aliases, I noticed a few errors when running Mongrel:
/Users/edgarschmidt/RailsDev/testapp/config/environment.rb:44: undefined method `time_zone=’ for #<Rails::Configuration:0x1151f48> (NoMethodError)
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:47:in `run’
from /Users/edgarschmidt/RailsDev/rails_space/config/environment.rb:13
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require’
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in’
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require’
from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/rails.rb:147:in `rails’
... 20 levels…
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
from script/server:3
After researching a bit, I found that my gems source repository was pointing to gem http://gems.rubyonrails.org and ended up installing a few gems that are on development (hence the errors). To fix this, I followed the next steps:
1) type the following on terminal:
>gem sources -r http://gems.rubyonrails.org
2) now type,
>gem list
and look at all the gems that are newer than 2.0.2 (latest stable version at the time of writing this). For me the “problematic” gems were version 2.0.2.9216
3) remove the gems you found on step (2). For example if actionmailer is one of them, type:
>gem uninstall -v=2.0.2.9216 actionmailer
don’t worry if you get any warnings.
4) When you remove rails, you might want to re-install it by typing:
> gem install -v=2.0.2 rails—include-dependencies
5) Now, the painful part. Remember that shiny app I was developing? I had to erase it (rm -r /edgarschmidt/RailsDev/testapp) because it was created under the “wrong” gems.
Good luck with this and I hope my notes save someone a couple of hours!
Rick
23 April 2008 at 10:55 am
When I ran some of the commands listed in the tutorial I needed be logged in as admin so that I could use sudo.
now when I type:
>which ruby
I get (logged in as admin):
/usr/bin/ruby
when I am not logged in as admin I get:
/usr/local/bin/ruby
Does anyone know if this is ok?
Rashwell
26 April 2008 at 6:59 pm
I am getting the same build error on the miniruby as the user “newbee” above. I read through the comments here but didn’t notice a solution, anyone have any ideas?
gcc -g -O2 -fno-common -pipe -fno-common -DRUBY_EXPORT -L. main.o dmydln.o libruby-static.a -lpthread -ldl -lobjc -o miniruby
ruby: [BUG] Segmentation fault
ruby 1.8.6 (2007-09-24) [i686-darwin9.2.2]
make: *** [.rbconfig.time] Abort trap
Thor:ruby-1.8.6-p111 rashwell$
JjP
27 April 2008 at 9:01 am
I have a key question here and I guess all of you might have the answer.
I’ve got used to work on Mac OS X using a normal user account, without admin privileges. If I need to do something as an admin I use the admin user name and password in GUI dialogues prompts or log into admin account. I have been developing simple things like a front end of web sites where TextMage and CSS Edit were doing their job.
Now I want to jump onto a more serious development starting from RoR and I am struggling with finding best practice in terms of whether should I give my normal account admin privileges or should I set up a separate developer account with admin privileges and develop from there?
I know it is simpler to just have admin privileges, but I would prefer to avoid that somehow as I guess admin privileges should be used only for… admin tasks.
Great tutorial BTW.
Arun
27 April 2008 at 11:44 am
Hello,
Thank you, Dan, for your awesome tutorial. Really appreciate it!
For those of you who are having trouble with the Ruby path being output as ‘/usr/bin/ruby’, try defining your PATH in the .bash_profile page instead of .bash_login. That worked for me. Same with the MySQL ‘Command Not Found’ error.
Cheers.
Grifas
28 April 2008 at 3:16 am
i did follow all steps with exception of i haven’t installed XCode, at the end after typing “which ruby” I’ve got: usr/bin/ruby instead of usr/local/bin/ruby. Is it because I missed to install XCode? All comments are greatly appreciated.
Bedrich
30 April 2008 at 12:10 am
Everyone has said it, but it deserves to be said again, THANKS!
Adam
01 May 2008 at 11:40 am
Thanks Dan, and also thank you Arun. You were right about editing profile instead of login.
phil
05 May 2008 at 3:27 pm
Mac19:src phil$ sudo gem install rails
ERROR: could not find rails locally or in a repository
I cannot find the fix… Following everything to the letter.
How do I manually point gem to the location of rails?
Mike
05 May 2008 at 9:25 pm
@Smitty
I got the same curl error - trying to run
‘curl -O ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p111.tar.gz’ and I’m getting an error…curl: (23) Failed writing body.’
You’ve probably had sudo timeout - “Once a user has been authenticated, a timestamp is updated and the user may then use sudo without a password for a short period of time (5 minutes unless overridden).”
So try this instead and you should be good to go:
sudo curl -O ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p111.tar.gz
jason
07 May 2008 at 11:28 pm
Looking for some help. I have OSX Leopard with MySQL gem installed and still get the “Mysql::Error: Lost connection to MySQL server during query:...”
which gem => /usr/local/bin/gem
which ruby => /usr/local/bin/ruby
which mysql => /usr/local/mysql/bin/mysql
gem list mysql => “*** LOCAL GEMS *** mysql (2.7)”
Any help will be appreciated.
Eddie
08 May 2008 at 9:54 pm
Hello Dan, et al
Thanks for providing some steps on how to build Ruby on Leopard. I have been using MacPorts to do so for me but with 10.5.2 there was some sort of change that caused the MacPorts ruby portfile to break. So I’m going it on my own. I was successful in getting ruby 1.8.6 to build per your suggestions, but one thing I was wondering about—you pass a CFLAG to the gcc compiler which I have not seen before, specifically:
CFLAGS=-D_XOPEN_SOURCE=1
I did some Google searching but was unable to find the meaning of the CFLAG “D_XOPEN_SOURCE” ... and I interestingly I noticed that the MacPort ruby portfile does not pass the D_XOPEN_SOURCE CFLAG to the compiler when building ruby. I would appreciate it if you could provide a logic for doing so, thank you very much!
-Eddie
Dan Benjamin
28 May 2008 at 5:04 pm
It seems that in a recent attempt remove some spam, I may have inadvertently removed a few valid comments along the way. Sorry about that.
jp
30 May 2008 at 5:12 pm
Great instructions, thx.
Cheers, jp
Ron Green
01 June 2008 at 2:55 pm
I’m having trouble using these directions to install ruby 1.8.7.
I have altered the first command to read:
curl -0 ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.gz
but it just stops running after a minute or two and doesn’t return the prompt.
If I can get past step 1 what would step 2 look like?
Ron Green
01 June 2008 at 2:59 pm
I’m having trouble using these directions to install ruby 1.8.7.
I have altered the first command to read:
curl -0 ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.gz
but it just stops running after a minute or two and doesn’t return the prompt.
If I can get past step 1 what would step 2 look like?
Ron Green
01 June 2008 at 3:53 pm
I’m having trouble using these directions to install ruby 1.8.7.
I have altered the first command to read:
curl -0 ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.gz
but it just stops running after a minute or two and doesn’t return the prompt.
If I can get past step 1 what would step 2 look like?
Curt Sheller
01 June 2008 at 4:32 pm
I modified the directions like this and it installed, compiled and seems to have worked.
curl -O ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.gz
tar xzvf ruby-1.8.7.tar.gz
cd ruby-1.8.7
./configure—enable-shared—enable-pthread CFLAGS=-D_XOPEN_SOURCE=1
make
sudo make install
cd ..
Ron Green
01 June 2008 at 6:08 pm
Thank you Curt.
Scott Clausen
01 June 2008 at 8:32 pm
When I run the command,
./configure—enable-shared—enable-pthread CFLAGS=-D_XOPEN_SOURCE=1
it doesn’t see any compiler and so I can’t run make. Can anyone help? This is my first time doing this and I’m stumped.
Thanks
David Schwartz
02 June 2008 at 1:24 am
I had the exact same problem as Todd on March 30. Was there a solution offered for that problem? Also, I got the following while installing mongrel:
No definition for dummy_dump
No definition for dummy_dump
No definition for rb_queue_marshal_load
No definition for rb_queue_marshal_dump
Is this a problem?
TIA for your help,
David
murphy
03 June 2008 at 6:45 am
I get a MUCH better performance (up to 3x!) when I compile without—enable-pthread and with -O3. pthread really seems to slow things down. I heard you need it for tk, but I don’t use it.
05 June 2008 at 2:35 am
while this is great, i’m sure, but i’m a total newb and thought i probably should take the vanilla route of installing and figuring out RoR… so how do I undo all of this? I got up to the Ruby Gems step…
Also how to i change the pathname to how it was regularly?
Is it possible to use the same pathname while using the whole MacPorts avenue of installing RoR, etc?
Thanks for all the help! I’m def a little lost…
black milk
05 June 2008 at 2:35 am
while this is great, i’m sure, but i’m a total newb and thought i probably should take the vanilla route of installing and figuring out RoR… so how do I undo all of this? I got up to the Ruby Gems step…
Also how to i change the pathname to how it was regularly?
Is it possible to use the same pathname while using the whole MacPorts avenue of installing RoR, etc?
Thanks for all the help! I’m def a little lost…
blackmilk
05 June 2008 at 2:38 am
wait, do I just delete the /usr/local/ file and its done?
Ron Green
08 June 2008 at 1:48 pm
No matter what I do I can’t get the path to change, When I run which ruby it keeps going to /usr/bin ruby. Here is my Path:
export PATH=”/usr/local/bin:/usr/local/sbin:$PATH”
I have put this in both .bash_login and .bash_profile but nothing seems to work. I have verified ruby exists at /usr/local/bin.
Help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Ron Green
08 June 2008 at 3:32 pm
Nevermind. I ran Repair Permissions which seems to have fixed the problem.
brianp
09 June 2008 at 4:22 pm
I have used the tut on many unit and it has always run fine. Great guide. This one time though it has seemed to fail. I feel it is because i tried running another guide which involved updating readline. But now i cannot seem to have this issue fixed. Is there a way i could just start from scratch ? I’ve re-run the guide a few times over and the problem is still here, any suggestions ?
Loading development environment (Rails 2.1.0)
dyld: NSLinkModule() error
dyld: Symbol not found: _rl_filename_completion_function
Referenced from: /usr/local/lib/ruby/1.8/i686-darwin9.3.0/readline.bundle
Expected in: flat namespace
Trace/BPT trap
brianp
09 June 2008 at 4:46 pm
After a day of looking with no luck i posted above. Not 5 minutes later this worked for me:
in /usr/local/bin/ruby-1.8.6-p111/ext/readline
#sudo make clean
#sudo ruby extconf.rb
#sudo make
#sudo make install
everything is back to normal now.
Mason
10 June 2008 at 8:57 pm
Those of you trying to install readline 5.1 with gcc 4.0.1… I had to make a modification to the generated Makefile to get the sucker to make.
Around line 82 (depending), change:
SHOBJ_LDFLAGS = -dynamic
to
SHOBJ_LDFLAGS = -dynamiclib
Jeff
12 June 2008 at 8:25 am
Great, thanks!
Maarten Porters
18 June 2008 at 9:01 am
Great tutorial! ... thumbs up
ronan
19 June 2008 at 10:05 am
great tutorial! thanks, thanks, thanks. :-)
oli
14 July 2008 at 9:47 pm
I had a “readline NSLinkModule() error”, and used the instructions from brianp to get iRB back/readline behaving. They worked for p114. Done in;
/usr/local/src/ruby-1.8.6-p114/ext/readline
Peter Cottontail
25 July 2008 at 10:36 am
Thank you very much for this tutorial. It got me up and running in no time.
Harry G.
26 July 2008 at 7:20 pm
Thanks a lot, Dan! - This worked perfectly, even for a command-line cripple like me. Go ahead!
Richard Delph
29 July 2008 at 9:51 pm
Hi Dan,
First of all a massive thanks for the 3 articles I’ve just read (and am now somewhat mesmerized by your vast intellect!), those articles being ‘Using /usr/local’, ‘MySQL Install’, and finally this one. Well not in that order, back to front if anything but I got there in the end. I’ve used Terminal and other shells before but never once built anything from source to install so as you can imagine I was absolutely bricking this. Had a few issues with mysql: first off trying to install the gem without having actually installed mysql oops and secondly the mysql.sock issue a few people seem to be having but somehow, a computer miracle no doubt, it sorted itself out after continuing with the tutorial (I was attempting, as the mysql install said, to set root passwords after executing the following:
cd /usr/local/mysql
sudo ./bin/mysql_install_db—user=mysql
sudo chown -R mysql ./var
). Left setting them till last though and everything worked as planned.
FYI I’m on a clean Leopard (10.5.4) install running Ruby 1.8.7-p22, Gems 1.2.0, and MySQL 5.0.51b generic source.
Thanks again
Rich
Patrick Berkeley
31 July 2008 at 4:40 am
Was getting this error on irb:
dyld: NSLinkModule() error
dyld: Symbol not found: _rl_filename_completion_function
Referenced from: /usr/local/lib/ruby/1.8/i686-darwin9.4.0/readline.bundle
Expected in: flat namespace
Trace/BPT trap
Solution was to do as brian(above suggested):
cd /usr/local/bin/ruby-1.8.6-p111/ext/readline
sudo make clean
sudo ruby extconf.rb
sudo make
sudo make install
Bob
03 August 2008 at 1:41 pm
How do i uninstall ruby using this method?
Garry Freemyer
03 July 2009 at 4:25 am
I am having the same trouble as Todd K has when trying to install the mysql gem.
This seems to be an international joke to never answer this question and I am getting pissed off at this.
I installed ruby on a windows system and was up and running before I can blink but it seems everyone has an unknown agreement NOT to answer this question…
SOLVE THIS PLEASE!!!
WARNING: Installing to ~/.gem since /Library/Ruby/Gems/1.8 and
/usr/bin aren’t both writable.
WARNING: You don’t have /Users/garryfre/.gem/ruby/1.8/bin in your PATH,
gem executables will not run.
Building native extensions. This could take a while…
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lm… yes
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lz… yes
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lsocket… no
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lnsl… no
checking for mysql_query() in -lmysqlclient… no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
—with-opt-dir
—without-opt-dir
—with-opt-include
—without-opt-include=${opt-dir}/include
—with-opt-lib
—without-opt-lib=${opt-dir}/lib
—with-make-prog
—without-make-prog
—srcdir=.
—curdir
—ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
—with-mysql-config
—without-mysql-config
—with-mysql-dir
—without-mysql-dir
—with-mysql-include
—without-mysql-include=${mysql-dir}/include
—with-mysql-lib
—without-mysql-lib=${mysql-dir}/lib
—with-mysqlclientlib
—without-mysqlclientlib
—with-mlib
—without-mlib
—with-mysqlclientlib
—without-mysqlclientlib
—with-zlib
—without-zlib
—with-mysqlclientlib
—without-mysqlclientlib
—with-socketlib
—without-socketlib
—with-mysqlclientlib
—without-mysqlclientlib
—with-nsllib
—without-nsllib
—with-mysqlclientlib
—without-mysqlclientlib
Gem files will remain installed in /Users/garryfre/.gem/ruby/1.8/gems/mysql-2.7 for inspection.
Results logged to /Users/garryfre/.gem/ruby/1.8/gems/mysql-2.7/gem_make.out
Gerald
10 July 2009 at 10:29 pm
Damn… Compiling Ruby doesn’t work. I get this error:
make[1]: *** [readline.o] Error 1
make: *** [all] Error 1
This is the what the Terminal tried to do while compiling:
http://stangl.net/code/terminal-ruby-failure.txt
Any suggestions what might be wrong?
optitiproni
11 July 2009 at 8:42 pm
<a >www.google.com/coop/cse?cx=011181623511421801838:jo0osqswr6g</a>
<a >www.google.com/coop/profile?user=011181623511421801838&leftnav=no_dir ectory</a>
<a >www.google.com/coop/cse?cx=011181623511421801838:n0bdrak6lrm</a>
<a >www.bebo.com/SanekK</a>
<a >www.bebo.com/DiscountV</a>
<a >www.bebo.com/EmilV74</a>
riccardo
12 July 2009 at 11:39 am
I followed this tutorial and the Mysql tutorial two times but I still get this error:
riccardotacconi ~/dev/demo>rake db:create
(in /Users/riccardotacconi/dev/demo)
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.
rake aborted!
no such file to load—mysql
(See full trace by running task with—trace)
riccardotacconi ~/dev/demo>
The project rails -q mysql demo has the database configured, the mysql gem is installed, but it seems the ruby is not able to load. I spent two days and I am at the same point.
Adam
14 July 2009 at 3:06 am
How do you know what options to use for the ./configure command when compiling the source?
Also…can you point me in the right direction for a tutorial on Uninstalling software that is installed in this fashion?
Thanks
David A Teare
17 July 2009 at 3:00 pm
Every time I get a new mac I follow these lovely instructions.
Thank you!!
Constantino
26 July 2009 at 6:21 pm
I’m absolutely new and have zero knowledge of unix, shell, etc. Sorry, I came back from a frozen state, I used to code in assembler in my C64 and Amiga.. sorry..
I get the following error at the point when I type: ./configure—enable-shared—enable-pthread CFLAGS=-D_XOPEN_SOURCE=1
checking build system type… i686-apple-darwin9.7.0
checking host system type… i686-apple-darwin9.7.0
checking target system type… i686-apple-darwin9.7.0
checking for gcc… no
checking for cc… no
checking for cl.exe… no
configure: error: no acceptable C compiler found in $PATH
See `config.log’ for more details.
So obviously I don’t have gcc or any other compiler. How can I get one ? (sorry for the stupid question)
Constantino
26 July 2009 at 6:56 pm
Maybe if I had installed xcode before I would not have asked such a stupid question. Well, I’m downloading it now, perhaps I’ll be able to compile and get to the end of this instructions.. Sorry for wasting bandwidth with my previous post. :(. Will keep you posted ;)
a
28 July 2009 at 10:57 am
i m getting a major major problen in install sqlite3 gem it shows errors as…dese
No definition for _wrap_sqlite3_value_text16be
No definition for _wrap_sqlite3_value_type
No definition for _wrap_sqlite3_result_blob
No definition for _wrap_sqlite3_result_double
No definition for _wrap_sqlite3_result_error
No definition for _wrap_sqlite3_result_error16
No definition for _wrap_sqlite3_result_int
No definition for _wrap_sqlite3_result_int64
No definition for _wrap_sqlite3_result_text
No definition for _wrap_sqlite3_result_text16
No definition for _wrap_sqlite3_result_text16le
No definition for _wrap_sqlite3_result_text16be
No definition for _wrap_sqlite3_result_value
No definition for _wrap_sqlite3_aggregate_context
nd mny mre…..
please help out
kodegeek
29 July 2009 at 11:35 am
Great Article! Everything went fine but when i run make command after get the ruby it shows one error although i proceeded and installed the others. would you have a check the messages to figure out the what was the error here.
http://pastie.org/563465
Nick
08 August 2009 at 11:24 am
Thanks for the write up, worked as a charm. Instead of installing mongrel etc, I recommend installing mod_rails (aka passenger) Check out http://railscasts.com/episodes/122-passenger-in-development for a how to, but do take into account that the paths Ryan uses in the screencast should be changed to /usr/local/ruby.
Coldcosts
17 August 2009 at 1:34 pm
I keep getting to the install rails point and getting this error. Any help would be welcome.
Mini:rubygems-1.3.1 jaylavoie$ cd ..
Mini:src jay$ sudo gem install rails
Bulk updating Gem source index for: http://gems.rubyforge.org
ERROR: Error installing rails:
fastthread requires RubyGems version >= 1.2
lostN00b
25 August 2009 at 12:20 pm
As a totall n00b it took me forever to work this out but the bin folder above seems to be out of the path, which meant insane version problems with my base install on osx. I changed the path in step two to this:
export PATH=”/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/lib/ruby/gems/1.8/bin/:$PATH”
ie I added /usr/local/lib/ruby/gems/1.8/bin/ to the second step in this article, and voila! I’ll leave it to someone who has a clue what they are talking about to figure out why :)
tominated
27 August 2009 at 6:45 am
Great article, but i seemed to have completely f*cked my ruby install up be changing a few things i shouldn’t have. is there any way to completely remove this ruby install and start again?
Thomas Fritzen
30 August 2009 at 3:58 am
What do I need if I keep getting this error. Do I have the wrong version of OS X
configure: error: no acceptable C compiler found in $PATH
See `config.log’ for more details.
This is the version I am running.
System Version: Mac OS X 10.4.11 (8S2167)
Kernel Version: Darwin 8.11.1
Boot Volume: Macintosh HD
Thanks
Thomas
Fernanda
31 August 2009 at 9:13 pm
@Thomas,
You probably don’t have XCode installed. You can get it from your installation CD or http://developer.apple.com/.
Thomas
02 September 2009 at 4:45 am
Thanks for the help. I seem to have an issue when I run this command.
sudo curl -O ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p111.tar.gz
Error message
curl: (7) couldn’t connect to host
I get a timeout error message. did the FTP name change?
Thanks
peter
13 September 2009 at 5:07 pm
Does your hardwood floors have wax build up and scratches?
It is time to refinish them and make the hardwood look brand new again.
Read more here:
http://www.hardwoodfloor.x10hosting.com
Lane
19 September 2009 at 6:12 pm
I am having an issue with getting this to install. While following the steps in the snow leopard instructions, I also got that there was no acceptable C complier error.
I have the latest Xcode installed as of the day this was posted. (3.1.4)
I modified the path to include /Xcode/usr/bin and sbin and then it would proceed a bit farther and give me a warning that gcc can not make an executable.
>configure: error: in `/Users/lillq/src/ruby-1.9.1-p243’:
>configure: error: C compiler cannot create executables
I posted this question to SuperUser.com as well with a bit more detail if that helps: http://superuser.com/questions/43857/installing-ruby-from-source-and-having-a-problem-with-gcc
Is there something that I am missing? Thanks-
monstroryuike
21 September 2009 at 8:48 pm
111111111111111111111111111111111
Kristen Hazard
23 September 2009 at 6:11 pm
@Gerald
Or anybody else,
If you get the following error at make:
gcc -I. -I../.. -I../../. -I../.././ext/readline -DHAVE_READLINE_READLINE_H -DHAVE_READLINE_HISTORY_H -DHAVE_RL_DEPREP_TERM_FUNCTION -DHAVE_RL_COMPLETION_APPEND_CHARACTER -DHAVE_RL_BASIC_WORD_BREAK_CHARACTERS -DHAVE_RL_COMPLETER_WORD_BREAK_CHARACTERS -DHAVE_RL_BASIC_QUOTE_CHARACTERS -DHAVE_RL_COMPLETER_QUOTE_CHARACTERS -DHAVE_RL_FILENAME_QUOTE_CHARACTERS -DHAVE_RL_ATTEMPTED_COMPLETION_OVER -DHAVE_RL_LIBRARY_VERSION -DHAVE_RL_EVENT_HOOK -DHAVE_RL_CLEANUP_AFTER_SIGNAL -DHAVE_REPLACE_HISTORY_ENTRY -DHAVE_REMOVE_HISTORY -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -D_XOPEN_SOURCE=1 -fno-common -pipe -fno-common -c readline.c
readline.c: In function ‘filename_completion_proc_call’:
readline.c:703: error: ‘filename_completion_function’ undeclared (first use in this function)
readline.c:703: error: (Each undeclared identifier is reported only once
readline.c:703: error: for each function it appears in.)
readline.c:703: warning: assignment makes pointer from integer without a cast
readline.c: In function ‘username_completion_proc_call’:
readline.c:730: error: ‘username_completion_function’ undeclared (first use in this function)
readline.c:730: warning: assignment makes pointer from integer without a cast
{standard input}:358:non-relocatable subtraction expression, “_mReadline” minus “L00000000007$pb”
{standard input}:358:symbol: “_mReadline” can’t be undefined in a subtraction expression
{standard input}:356:non-relocatable subtraction expression, “_completion_case_fold” minus “L00000000007$pb”
{standard input}:356:symbol: “_completion_case_fold” can’t be undefined in a subtraction expression
{standard input}:342:non-relocatable subtraction expression, “_mReadline” minus “L00000000007$pb”
{standard input}:342:symbol: “_mReadline” can’t be undefined in a subtraction expression
{standard input}:340:non-relocatable subtraction expression, “_completion_proc” minus “L00000000007$pb”
{standard input}:340:symbol: “_completion_proc” can’t be undefined in a subtraction expression
{standard input}:321:non-relocatable subtraction expression, “_mReadline” minus “L00000000006$pb”
{standard input}:321:symbol: “_mReadline” can’t be undefined in a subtraction expression
{standard input}:319:non-relocatable subtraction expression, “_completion_case_fold” minus “L00000000006$pb”
{standard input}:319:symbol: “_completion_case_fold” can’t be undefined in a subtraction expression
{standard input}:297:non-relocatable subtraction expression, “_mReadline” minus “L00000000005$pb”
{standard input}:297:symbol: “_mReadline” can’t be undefined in a subtraction expression
{standard input}:295:non-relocatable subtraction expression, “_completion_case_fold” minus “L00000000005$pb”
{standard input}:295:symbol: “_completion_case_fold” can’t be undefined in a subtraction expression
{standard input}:275:non-relocatable subtraction expression, “_mReadline” minus “L00000000004$pb”
{standard input}:275:symbol: “_mReadline” can’t be undefined in a subtraction expression
{standard input}:273:non-relocatable subtraction expression, “_completion_proc” minus “L00000000004$pb”
{standard input}:273:symbol: “_completion_proc” can’t be undefined in a subtraction expression
{standard input}:251:non-relocatable subtraction expression, “_mReadline” minus “L00000000003$pb”
{standard input}:251:symbol: “_mReadline” can’t be undefined in a subtraction expression
{standard input}:249:non-relocatable subtraction expression, “_completion_proc” minus “L00000000003$pb”
{standard input}:249:symbol: “_completion_proc” can’t be undefined in a subtraction expression
make[1]: *** [readline.o] Error 1
make: *** [all] Error 1
These 2 posts helped me solve this problem:
http://blog.angelbob.com/posts/39-Compiling-Ruby-1-8-7-on-a-PowerBook-G4-with-Mac-OS-X-1-4___published-ruby
http://blog.robseaman.com/2008/12/10/from-ruby-1-8-6-to-1-87-and-back-again-on-leopard
sativandra
02 October 2009 at 11:03 pm
Great info, thanks a lot… :D
Dallas
04 October 2009 at 7:20 pm
First of, and foremost, thanks for all the great tutorials over the years. I use them all the time.
Secondly, unfortunately, I’m having some issues installing ruby—particularly with the make portion of that section.
Here is the output from Terminal:
$ make
gcc -D_XOPEN_SOURCE=1 -fno-common -pipe -fno-common -DRUBY_EXPORT -L. main.o dmydln.o libruby-static.a -lpthread -ldl -lobjc -o miniruby
rbconfig.rb unchanged
cc -dynamiclib -undefined suppress -flat_namespace -install_name /usr/local/lib/libruby.dylib -current_version 1.8.7 -compatibility_version 1.8 array.o bignum.o class.o compar.o dir.o dln.o enum.o enumerator.o error.o eval.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o util.o variable.o version.o dmyext.o -o libruby.1.8.7.dylib
compiling Win32API
make[1]: Nothing to be done for `all’.
compiling bigdecimal
make[1]: Nothing to be done for `all’.
compiling curses
make[1]: Nothing to be done for `all’.
compiling dbm
make[1]: Nothing to be done for `all’.
compiling digest
make[1]: Nothing to be done for `all’.
compiling digest/bubblebabble
make[1]: Nothing to be done for `all’.
compiling digest/md5
make[1]: Nothing to be done for `all’.
compiling digest/rmd160
make[1]: Nothing to be done for `all’.
compiling digest/sha1
make[1]: Nothing to be done for `all’.
compiling digest/sha2
make[1]: Nothing to be done for `all’.
compiling dl
make[1]: Nothing to be done for `all’.
compiling etc
make[1]: Nothing to be done for `all’.
compiling fcntl
make[1]: Nothing to be done for `all’.
compiling gdbm
make[1]: Nothing to be done for `all’.
compiling iconv
make[1]: Nothing to be done for `all’.
compiling io/wait
make[1]: Nothing to be done for `all’.
compiling nkf
make[1]: Nothing to be done for `all’.
compiling openssl
make[1]: Nothing to be done for `all’.
compiling pty
make[1]: Nothing to be done for `all’.
compiling racc/cparse
make[1]: Nothing to be done for `all’.
compiling readline
gcc -I. -I../.. -I../../. -I../.././ext/readline -DHAVE_READLINE_READLINE_H -DHAVE_READLINE_HISTORY_H -DHAVE_RL_FILENAME_COMPLETION_FUNCTION -DHAVE_RL_COMPLETION_MATCHES -DHAVE_RL_DEPREP_TERM_FUNCTION -DHAVE_RL_COMPLETION_APPEND_CHARACTER -DHAVE_RL_BASIC_WORD_BREAK_CHARACTERS -DHAVE_RL_COMPLETER_WORD_BREAK_CHARACTERS -DHAVE_RL_BASIC_QUOTE_CHARACTERS -DHAVE_RL_COMPLETER_QUOTE_CHARACTERS -DHAVE_RL_FILENAME_QUOTE_CHARACTERS -DHAVE_RL_ATTEMPTED_COMPLETION_OVER -DHAVE_RL_LIBRARY_VERSION -DHAVE_RL_EVENT_HOOK -DHAVE_RL_CLEANUP_AFTER_SIGNAL -DHAVE_REPLACE_HISTORY_ENTRY -DHAVE_REMOVE_HISTORY -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -D_XOPEN_SOURCE=1 -fno-common -pipe -fno-common -c readline.c
readline.c: In function ‘username_completion_proc_call’:
readline.c:730: error: ‘username_completion_function’ undeclared (first use in this function)
readline.c:730: error: (Each undeclared identifier is reported only once
readline.c:730: error: for each function it appears in.)
make[1]: *** [readline.o] Error 1
make: *** [all] Error 1
What is this “Nothing to be done for ‘all’.” business?
So lost … any and all help will be warmly welcome :)
Thanks!
Jez Cowley
13 October 2009 at 3:26 pm
HI Guys,
Great Site Dan,
Thanks for all this information. I’ve heard so much about RoR and really want to get to grips with, But have had no success in building my development environment. on two different macs
Is there any way I can remove all the components and start again from scratch or is it going to be easier to do a clean reinstall?
PS I have had similar ‘nothing done for all’ errors as dallas, above, upon running $make.
Obviously I would much rather rectify and learn where im going wrong than reinstall.
Any or all help would be greatly appreciated.
Thanks All
Jez
Rafael
31 October 2009 at 11:01 am
Hi Dan,
I have followed your instructions on changing the path to the ruby interpreter and when I ask “which ruby”
it keeps showing the “/usr/bin/ruby” instead of “/usr/local/bin/ruby”.
please help!
Giovanni
05 November 2009 at 9:22 pm
Hey Dan,
First…Thanks for all of this it really makes it self explanatory.
However, the mkdir steps are just not making the directory at all for me. Once I get to cd /usr/local/src part I get back ‘No such file or directory’. I’ve checked info on ‘usr’ and ‘local’ and they’re both set to read & write.
Any Help much appreciated. THANKS!
Giovanni
06 November 2009 at 9:39 am
Never Mind, got through that bump by myself.
New bump though on the very last step for ruby ‘make install’.
these are the errors I get back.
macintosh:ruby-1.9.1-p243 giovadelarosa$ make install
./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb ./instruby.rb—make=“make”—dest-dir=””—extout=”.ext”—mflags=””—make-flags=””—data-mode=0644—prog-mode=0755—installed-list .installed.list—mantype=“doc”
installing binary commands
/usr/local/src/ruby-1.9.1-p243/lib/fileutils.rb:240:in `mkdir’: Permission denied - /usr/local/lib/ruby (Errno::EACCES)
from /usr/local/src/ruby-1.9.1-p243/lib/fileutils.rb:240:in `fu_mkdir’
from /usr/local/src/ruby-1.9.1-p243/lib/fileutils.rb:217:in `block (2 levels) in mkdir_p’
from /usr/local/src/ruby-1.9.1-p243/lib/fileutils.rb:215:in `reverse_each’
from /usr/local/src/ruby-1.9.1-p243/lib/fileutils.rb:215:in `block in mkdir_p’
from /usr/local/src/ruby-1.9.1-p243/lib/fileutils.rb:201:in `each’
from /usr/local/src/ruby-1.9.1-p243/lib/fileutils.rb:201:in `mkdir_p’
from ./instruby.rb:159:in `makedirs’
from ./instruby.rb:234:in `block in <main>’
from ./instruby.rb:409:in `call’
from ./instruby.rb:409:in `block (2 levels) in <main>’
from ./instruby.rb:406:in `each’
from ./instruby.rb:406:in `block in <main>’
from ./instruby.rb:402:in `each’
from ./instruby.rb:402:in `<main>’
make: *** [do-install-nodoc] Error 1
macintosh:ruby-1.9.1-p243 giovadelarosa$
now this I have no idea what to do with. HELP!
By the way I’m on intel 10.5.7. Did all the steps above but for 1.9.1 instead.
lilwoodenby
13 November 2009 at 9:18 am
Help on the PATH problem usr/bin/ruby to usr/local/bin/ruby
1. Mac OS X 10.5 (leopard)
2. XCode is installed
3. .profile, .bash_profile, .bash_login files have been edited (at the end) with export PATH=”/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH”
4. i even repaired permissions.
Still, /usr/bin/ruby. HELP!
Torgeir
21 November 2009 at 6:18 pm
@lilwoodenby try adding export PATH=/usr/local/bin/ruby:$PATH to your ~/.profile file and restart your terminal
john_st
26 November 2009 at 11:35 am
I am running Mac OS X Tiger 10.4.11 and I installed Ruby and Gems, following the guide on Hivelogic. Everything works ok up until the point where I need to install Rails. I enter this line in my Terminal:
sudo gem install rails—include-dependencies
and get this error
ERROR: While executing gem ... (Gem::RemoteSourceException)
HTTP Response 403
Please help
dang
06 December 2009 at 10:45 pm
Installing Ruby on OS X 10.5 I get the following:
make install
./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb ./instruby.rb—make=“make”—dest-dir=””—extout=”.ext”—mflags=””—make-flags=””—data-mode=0644—prog-mode=0755—installed-list .installed.list—mantype=“doc”
/bin/sh: ./miniruby: No such file or directory
make: *** [do-install-nodoc] Error 127
Any advice gratefully received!
Cheers,
dang.
Leumas
07 December 2009 at 1:27 am
RubyGems 1.2+ index not found for:
RubyGems will revert to legacy indexes degrading performance.
Bulk updating Gem source index for: http://gems.rubyforge.org/
Will
09 December 2009 at 4:56 pm
I am running Mac osx 10.5; MySQL your tutorial worked great. Now I would like to connect to the Netbeans IDE 6.5 for Ruby. I believe I need to change the standard /usr/bin/ruby to /usr/local/bin/ruby but the Netbeans Ruby Platform Manager is not cooperating.
Codin
30 December 2009 at 6:19 pm
Hello. I’m a boggled by this issue… @_@ any thoughts?
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9]
LW:~ codin$ sudo gem install mysql——with-mysql-dir=/usr/local/mysql
ERROR: Error installing mysql:
mysql requires Ruby version >= 1.8.6
LW:~ codin$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9]
Daniel
18 January 2010 at 10:33 pm
You rock man, found info here for compiling rails, postgres, also read the stuff about /usr/local, very nice :D i’m also starting with yoga and meditation, you are in my favorites now :D
Jonathan
27 January 2010 at 10:57 am
I’m fairly new to programming so apologies if this is a noob question: After finishing the installation, I found that
ruby -v will still show me ruby 1.8.7, not the installed 1.9.1
ruby19 -v throws out an error message as well.
Thanks a lot for this guide - by far the best I’ve found so far!
Matt Willhite
05 February 2010 at 11:54 pm
@Jonathan, why don’t you try using a tool like rvm to install multiple versions of ruby?