升级到 Ruby EE 后,Rails 2.3.8 将无法在 Passenger 上运行 - iconv 错误

发布于 2024-10-17 02:09:11 字数 3110 浏览 3 评论 0原文

我刚刚安装了 Ruby EE 11.01。我有一个 Rails 2.3.8 应用程序,它在 Apache2 上的 Passenger 3.0.2 上运行。现在,我的申请不会出现。错误是:

no such file to load -- iconv

我使用的是 Mac OS X 10.6.4。我安装 Ruby EE 时使用:

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

“which iconv”产生:

/opt/local/bin/iconv

尝试安装 gem iconv 产生:

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.

安装行中的 iconv 路径是否错误?帮助!

编辑:

查看上面的日志文件我看到这个:

    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 */

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

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 */

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倾听心声的旋律 2024-10-24 02:09:11

我强烈建议在 Mac 操作系统上使用 RVM。它的安装非常简单,它可以使用 readline、iconv、openssl、zlib 等来处理下载和编译环境。我无法告诉你它为我节省了多少个小时。

http://rvm.beginrescueend.com/

回到你的问题 - 你尝试过gem install iconv -- --with-iconv-dir=/opt/local

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 ?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文