RubyRedGrapefruit
RubyRedGrapefruit

Reputation: 12224

Rails 2.3.8 won't run on Passenger after upgrade to Ruby EE - iconv error

I just installed Ruby EE 11.01. I had a Rails 2.3.8 application that was running against Passenger 3.0.2 on Apache2. Now, my application will not come up. The error is:

no such file to load -- iconv

I am on Mac OS X 10.6.4. I installed Ruby EE with:

sudo ./installer -c --with-openssl-dir=/opt/local -c --with-readline-dir=/opt/local -c --with-iconv-dir=/opt/local

"which iconv" yields:

/opt/local/bin/iconv

Attempting to install gem iconv yields:

Building native extensions.  This could take a while...
ERROR:  Error installing iconv:
ERROR: Failed to build gem native extension.

/opt/ruby-enterprise-1.8.7-2011.01/bin/ruby extconf.rb
checking for iconv() in iconv.h... no
checking for iconv() in -liconv... 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.

is my iconv path wrong in the install line? Help!

EDIT:

Looking in the log file above I see this:

    checked program was:
    /* begin */
    1: #include <iconv.h>
    2:
    3: /*top*/
    4: int main() { return 0; }
    5: int t() { void ((*volatile p)()); p = (void ((*)()))iconv; return 0; }
    /* end */

    "gcc -o conftest -I. -I/opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/1.8/i686-darwin10.4.0 -I.  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -g -O2  -pipe -fno-common   conftest.c  -L. -L/opt/ruby-enterprise-1.8.7-2011.01/lib -L.      - lruby-static  -ldl -lobjc  "
    conftest.c: In function 't':
    conftest.c:5: error: too few arguments to function 'libiconv'
    checked program was:
    /* begin */
    1: #include <iconv.h>
    2:
    3: /*top*/
    4: int main() { return 0; }
    5: int t() { iconv(); return 0; }
    /* end */

    --------------------

    have_library: checking for iconv() in -liconv... -------------------- no

    "gcc -o conftest -I. -I/opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/1.8/i686-darwin10.4.0 -I.  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -g -O2  -pipe -fno-common   conftest.c  -L. -L/opt/ruby-enterprise-1.8.7-2011.01/lib -L.      - lruby-static -liconv  -ldl -lobjc  "
    Undefined symbols:
      "_libiconv", referenced from:
          _t in ccxx7BhR.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    checked program was:
    /* begin */
    1: #include <iconv.h>
    2:
    3: /*top*/
    4: int main() { return 0; }
    5: int t() { void ((*volatile p)()); p = (void ((*)()))iconv; return 0; }
    /* end */

    "gcc -o conftest -I. -I/opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/1.8/i686-darwin10.4.0 -I.  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -g -O2  -pipe -fno-common   conftest.c  -L. -L/opt/ruby-enterprise-1.8.7-2011.01/lib -L.      - lruby-static -liconv  -ldl -lobjc  "
    conftest.c: In function 't':
    conftest.c:5: error: too few arguments to function 'libiconv'
    checked program was:
    /* begin */
    1: #include <iconv.h>
    2:
    3: /*top*/
    4: int main() { return 0; }
    5: int t() { iconv(); return 0; }
    /* end */

    --------------------

Upvotes: 1

Views: 470

Answers (1)

MDaubs
MDaubs

Reputation: 3004

I highly recommend using RVM on Mac OS. It's extremely easy to install and it handles downloading and compiling the environment with readline, iconv, openssl, zlib, etc. I can't tell you how many hours it's saved me.

http://rvm.beginrescueend.com/

Back to your question - did you try gem install iconv -- --with-iconv-dir=/opt/local ?

Upvotes: 2

Related Questions