MacOSX (10.5.8), MAMP (1.8.4), rvm (0.1.23) and passenger-2.2.11 - need help please

508 views
Skip to first unread message

amitava

unread,
Mar 15, 2010, 11:54:01 AM3/15/10
to Phusion Passenger Discussions
After googling around and reading some of the discussions on attempts
to run passenger on MAMP (see links below), I have made progress but
stuck

Here are the steps I took

Setup/configure MAMP httpd source to used for passenger compilation/
installation
================================================================================
1. Download MAMP source (MAMP_src) and extract to $MAMP_src
2. Extract $MAMP_src/httpd-2.0.63
3. ./configure --prefix=/Application/MAMP/Library ($MAMP/Library)
4. copy $MAMP_src/httpd-2.0.63/build and $MAMP_src/httpd-2.0.63/
include to $MAMP/Library

rvm info
========
1. version
ashee-mac:passenger-2.2.11 amitava$ rvm -v

rvm 0.1.23 by Wayne E. Seguin (waynee...@gmail.com) [http://
rvm.beginrescueend.com/]

2. rvm is using ruby-1.8.7-p174

3. gemdir
ashee-mac:passenger-2.2.11 amitava$ rvm gemdir
/Users/amitava/.rvm/gems/ruby-1.8.7-p174

passenger setup
===============
1. gem install passenger --no-ri --no-rdoc

2. Setup useful environment variables
shee-mac:passenger-2.2.11 amitava$ source ~/tmp/passenger-env.sh
cat ~/tmp/passenger-env.sh
export APU_CONFIG=/Applications/MAMP/Library/bin/apu-config
export APR_CONFIG=/Applications/MAMP/Library/bin/apr-config
export APXS2=/Applications/MAMP/Library/bin/apxs
export HTTPD=/Applications/MAMP/Library/bin/httpd

I had to hack passenger couple of places in platform_info.rb
1. Line 339 - added additional header locations
flags = ["-D_REENTRANT -I/usr/local/include -I /Users/amitava/tmp/
MAMP_src/httpd-2.0.63/srclib/apr/include/ -I /Users/amitava/tmp/
MAMP_src/httpd-2.0.63/srclib/apr-util/include -I /Users/amitava/tmp/
MAMP_src/httpd-2.0.63/os/unix"]

2. Line 206 - not sure why but passenger is not able to figure out
rake location (the invoking shell is running rvm ruby-1.8.7-p174). I
am hardcoding it for now
return locate_ruby_executable('rake') || "/Users/amitava/.rvm/gems/
ruby-1.8.7-p174%global/bin/rake"

3. It builds fine now and I added the neccessary passenger
configuration in MAMP

LoadModule passenger_module /Users/amitava/.rvm/gems/ruby-1.8.7-p174/
gems/passenger-2.2.11/ext/apache2/mod_passenger.so
PassengerRoot /Users/amitava/.rvm/gems/ruby-1.8.7-p174/gems/
passenger-2.2.11
# PassengerRuby /Users/amitava/.rvm/rubies/ruby-1.8.7-p174/bin/ruby
PassengerRuby /Users/amitava/.rvm/bin/ruby-1.8.7-p174

<VirtualHost 127.0.0.1>
ServerAdmin amitav...@gmail.com
DocumentRoot /Users/amitava/tmp/bmrails/public
ServerName cms.localhost
</VirtualHost>

Error - Missing the Rails 2.3.5 gem
===================================
Ruby (Rack) application could not be started
The application has exited during startup (i.e. during the evaluation
of config/environment.rb). The error message can be found below. To
solve this problem, please follow any instructions in the error
message.

Error message:
Missing the Rails 2.3.5 gem. Please `gem install -v=2.3.5 rails`,
update your RAILS_GEM_VERSION setting in config/environment.rb for the
Rails version you do have installed, or comment out RAILS_GEM_VERSION
to use the latest version installed.
Application root:
/Users/amitava/tmp/bmrails

Backtrace:
# File Line Location
0 ./config/boot.rb 66 in `exit'
1 ./config/boot.rb 66 in `load_rails_gem'
2 ./config/boot.rb 54 in `load_initializer'
3 ./config/boot.rb 38 in `run'
4 ./config/boot.rb 11 in `boot!'
5 ./config/boot.rb 110
6 /Users/amitava/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/site_ruby/
1.8/rubygems/custom_require.rb 31 in `gem_original_require'
7 /Users/amitava/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/site_ruby/
1.8/rubygems/custom_require.rb 31 in `require'
8 ./config/environment.rb 8
9 /Users/amitava/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/site_ruby/
1.8/rubygems/custom_require.rb 31 in `gem_original_require'
10 /Users/amitava/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/site_ruby/
1.8/rubygems/custom_require.rb 31 in `require'
11 config.ru 4
12 /Users/amitava/.rvm/gems/ruby-1.8.7-p174/gems/rack-1.1.0/lib/
rack/builder.rb 46 in `instance_eval'
13 /Users/amitava/.rvm/gems/ruby-1.8.7-p174/gems/rack-1.1.0/lib/
rack/builder.rb 46 in `initialize'
14 config.ru 1 in `new'
15 config.ru 1
----------------------------------------------

This turns out to be a known issue -
https://rails.lighthouseapp.com/projects/8994/tickets/3685-actionpack-235-gem-declares-incompatibility-with-rack-110
So I uninstall rack 1.1.0
ashee-mac:passenger-2.2.11 amitava$ gem uninstall rack -v 1.1.0
Successfully uninstalled rack-1.1.0

Internal Server Error
=====================
Here's the apache error log
----------------------------------------------
dyld: lazy symbol binding failed: Symbol not found: _iconv_open
Referenced from: /Users/amitava/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/
1.8/i686-darwin9.8.0/iconv.bundle
Expected in: flat namespace

dyld: Symbol not found: _iconv_open
Referenced from: /Users/amitava/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/
1.8/i686-darwin9.8.0/iconv.bundle
Expected in: flat namespace

*** Exception EOFError in spawn manager (Unexpected end-of-file
detected.) (process 78625):
from /Users/amitava/.rvm/gems/ruby-1.8.7-p174/gems/passenger-2.2.11/
lib/phusion_passenger/utils.rb:306:in `unmarshal_and_raise_errors'
from /Users/amitava/.rvm/gems/ruby-1.8.7-p174/gems/passenger-2.2.11/
lib/phusion_passenger/rack/application_spawner.rb:71:in
`spawn_application'
from /Users/amitava/.rvm/gems/ruby-1.8.7-p174/gems/passenger-2.2.11/
lib/phusion_passenger/rack/application_spawner.rb:41:in
`spawn_application'
from /Users/amitava/.rvm/gems/ruby-1.8.7-p174/gems/passenger-2.2.11/
lib/phusion_passenger/spawn_manager.rb:159:in `spawn_application'
from /Users/amitava/.rvm/gems/ruby-1.8.7-p174/gems/passenger-2.2.11/
lib/phusion_passenger/spawn_manager.rb:287:in
`handle_spawn_application'
from /Users/amitava/.rvm/gems/ruby-1.8.7-p174/gems/passenger-2.2.11/
lib/phusion_passenger/abstract_server.rb:352:in `__send__'
from /Users/amitava/.rvm/gems/ruby-1.8.7-p174/gems/passenger-2.2.11/
lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
from /Users/amitava/.rvm/gems/ruby-1.8.7-p174/gems/passenger-2.2.11/
lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
from /Users/amitava/.rvm/gems/ruby-1.8.7-p174/gems/passenger-2.2.11/
bin/passenger-spawn-server:61
[ pid=75439 file=ext/apache2/Hooks.cpp:727 time=2010-03-15
11:50:16.917 ]:
Unexpected error in mod_passenger: Cannot spawn application '/Users/
amitava/tmp/bmrails': The spawn server has exited unexpectedly.
Backtrace:
in 'virtual boost::shared_ptr<Passenger::Application::Session>
Passenger::ApplicationPoolServer::Client::get(const
Passenger::PoolOptions&)' (ApplicationPoolServer.h:471)
in 'int Hooks::handleRequest(request_rec*)' (Hooks.cpp:523)

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

Any help is much appreciated.

References
===========
http://groups.google.com/group/phusion-passenger/browse_thread/thread/e6dac9d5ea0de9c1
http://groups.google.com/group/phusion-passenger/browse_thread/thread/2dd4ab1e3f34160a
https://rails.lighthouseapp.com/projects/8994/tickets/3685-actionpack-235-gem-declares-incompatibility-with-rack-110

Thanks & Regards,
Amitava Shee
Software Architect

There are two ways of constructing a software design. One is to make
it so simple that there are obviously no deficiencies; the other is to
make it so complicated that there are no obvious deficiencies. The
first method is far more difficult.
-- C. A. R. Hoare The Emperor's Old Clothes, CACM February 1981

Hongli Lai

unread,
Mar 15, 2010, 1:17:37 PM3/15/10
to phusion-...@googlegroups.com
On Mon, Mar 15, 2010 at 4:54 PM, amitava <amitav...@gmail.com> wrote:
> passenger setup
> ===============
> 1. gem install passenger --no-ri --no-rdoc
>
> 2. Setup useful environment variables
> shee-mac:passenger-2.2.11 amitava$ source ~/tmp/passenger-env.sh
> cat ~/tmp/passenger-env.sh
> export APU_CONFIG=/Applications/MAMP/Library/bin/apu-config
> export APR_CONFIG=/Applications/MAMP/Library/bin/apr-config
> export APXS2=/Applications/MAMP/Library/bin/apxs
> export HTTPD=/Applications/MAMP/Library/bin/httpd
>
> I had to hack passenger couple of places in platform_info.rb
> 1. Line 339 - added additional header locations
> flags = ["-D_REENTRANT -I/usr/local/include -I /Users/amitava/tmp/
> MAMP_src/httpd-2.0.63/srclib/apr/include/ -I /Users/amitava/tmp/
> MAMP_src/httpd-2.0.63/srclib/apr-util/include -I /Users/amitava/tmp/
> MAMP_src/httpd-2.0.63/os/unix"]
>
> 2. Line 206 - not sure why but passenger is not able to figure out
> rake location (the invoking shell is running rvm ruby-1.8.7-p174). I
> am hardcoding it for now
> return locate_ruby_executable('rake') || "/Users/amitava/.rvm/gems/
> ruby-1.8.7-p174%global/bin/rake"

Did you set the environment variables *after* starting a shell with
sudo? If you run passenger-install-apache2-module with sudo then sudo
will nuke almost all environment variables for security reasons. You
really should use sudo to enter a root shell, then set the environment
variables in that root shell, then run
passenger-install-apache2-module from that root shell. This is in fact
what our installation guide recommends.

Actually the issue you're experiencing is that Phusion Passenger's
Ruby doesn't find Rails 2.3.5. The Lighthouse ticket that you're
linking to only applies if the error message is something like "cannot
activate rack gem ~> 1.0.0".

Did you setup Phusion Passenger correctly? Phusion Passenger + RVM
requires special installation as described at
http://rvm.beginrescueend.com/integration/passenger/
It looks like you didn't set PassengerRuby as instructed.


> dyld: lazy symbol binding failed: Symbol not found: _iconv_open
>  Referenced from: /Users/amitava/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/
> 1.8/i686-darwin9.8.0/iconv.bundle
>  Expected in: flat namespace
>
> dyld: Symbol not found: _iconv_open
>  Referenced from: /Users/amitava/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/
> 1.8/i686-darwin9.8.0/iconv.bundle
>  Expected in: flat namespace

This looks like a problem in the Ruby installation.

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

amitava

unread,
Mar 16, 2010, 1:57:19 PM3/16/10
to Phusion Passenger Discussions
> Did you set the environment variables *after* starting a shell with
> sudo? If you run passenger-install-apache2-module with sudo then sudo
> will nuke almost all environment variables for security reasons. You
> really should use sudo to enter a root shell, then set the environment
> variables in that root shell, then run
> passenger-install-apache2-module from that root shell. This is in fact
> what our installation guide recommends.
>
I am not using sudo.

> Actually the issue you're experiencing is that Phusion Passenger's
> Ruby doesn't find Rails 2.3.5. The Lighthouse ticket that you're
> linking to only applies if the error message is something like "cannot
> activate rack gem ~> 1.0.0".

I was getting RAILS_GEM not found error. I tested this with thin as
well. Upon uninstalling rack 1.1.0, thin is serving up the application
fine. I even saw the reason (in rails code) why it is so in the thread
in the ticket.

In any case, uninstalling rack 1.1.0 got me past the RAILS_GEM issue.

>
> Did you setup Phusion Passenger correctly? Phusion Passenger + RVM

> requires special installation as described athttp://rvm.beginrescueend.com/integration/passenger/


> It looks like you didn't set PassengerRuby as instructed.

I did follow the recommendation. I am in fact pointing to ~/.rvm/bin/
ruby-1.8.7-p174 which is the wrapper shell script. Here's my
passenger.conf snippet

LoadModule passenger_module /Users/amitava/.rvm/gems/ruby-1.8.7-p174/
gems/passenger-2.2.11/ext/apache2/mod_passenger.so
PassengerRoot /Users/amitava/.rvm/gems/ruby-1.8.7-p174/gems/
passenger-2.2.11
# PassengerRuby /Users/amitava/.rvm/rubies/ruby-1.8.7-p174/bin/ruby
PassengerRuby /Users/amitava/.rvm/bin/ruby-1.8.7-p174

Notice, how I have commented out the 2nd last line. I tried pointing
to both and retained the approach suggested in rvm website.


> This looks like a problem in the Ruby installation.
>

I am able to use the same rvm based ruby while running in thin (as
rack application)

-Amitava

Hongli Lai

unread,
Mar 16, 2010, 5:44:00 PM3/16/10
to phusion-...@googlegroups.com
I suspect it's all a matter of setting the right environment
variables. The instructions at
http://rvm.beginrescueend.com/integration/passenger/ say that one
should set PassengerRuby to ~/.rvm/bin/passenger_ruby, not
~/.rvm/bin/ruby-1.8.7-p174 as you're currently doing. The executable
that you're pointing to is the raw Ruby interpreter, but it won't work
unless the right RVM environment variables are set;
~/.rvm/bin/passenger_ruby on the other hand is a wrapper script which
sets the right RVM environment variables before starting the Ruby
interpreter.

The reason why Thin works is because Thin is started from the command
line and thus inherits all environment variables. Phusion Passenger's
Ruby is started from Apache which doesn't inherit command line
environment variables.

amitava

unread,
Mar 17, 2010, 1:35:30 AM3/17/10
to Phusion Passenger Discussions
> variables. The instructions athttp://rvm.beginrescueend.com/integration/passenger/say that one

> should set PassengerRuby to ~/.rvm/bin/passenger_ruby, not
> ~/.rvm/bin/ruby-1.8.7-p174 as you're currently doing. The executable
> that you're pointing to is the raw Ruby interpreter, but it won't work
> unless the right RVM environment variables are set;
> ~/.rvm/bin/passenger_ruby on the other hand is a wrapper script which
> sets the right RVM environment variables before starting the Ruby
> interpreter.

I did follow the instructions from http://rvm.beginrescueend.com/integration/passenger.
Here is the content of $HOME/.rvm/bin/ruby-1.8.7-p174
================

#!/usr/bin/env bash

export GEM_HOME="/Users/amitava/.rvm/gems/ruby-1.8.7-p174"
export GEM_PATH="/Users/amitava/.rvm/gems/ruby-1.8.7-p174:/Users/
amitava/.rvm/gems/ruby-1.8.7-p174%global"
export BUNDLE_PATH="/Users/amitava/.rvm/gems/ruby-1.8.7-p174"
export MY_RUBY_HOME="/Users/amitava/.rvm/rubies/ruby-1.8.7-p174"
export PATH="/Users/amitava/.rvm/rubies/ruby-1.8.7-p174/bin:/Users/
amitava/.rvm/gems/ruby-1.8.7-p174/bin:/Users/amitava/.rvm/gems/
ruby-1.8.7-p174%global/bin:/Users/amitava/.rvm/bin:$PATH"

exec "/Users/amitava/.rvm/rubies/ruby-1.8.7-p174/bin/ruby" "$@"
=======================

Content of passenger_ruby (which is a symlink to .rvm/bin/
ree-1.8.7-2010.01)
========================
#!/usr/bin/env bash

export GEM_HOME="/Users/amitava/.rvm/gems/ree-1.8.7-2010.01"
export GEM_PATH="/Users/amitava/.rvm/gems/ree-1.8.7-2010.01:/Users/
amitava/.rvm/gems/ree-1.8.7-2010.01%global"
export BUNDLE_PATH="/Users/amitava/.rvm/gems/ree-1.8.7-2010.01"
export MY_RUBY_HOME="/Users/amitava/.rvm/rubies/ree-1.8.7-2010.01"
export PATH="/Users/amitava/.rvm/rubies/ree-1.8.7-2010.01/bin:/Users/
amitava/.rvm/gems/ree-1.8.7-2010.01/bin:/Users/amitava/.rvm/gems/
ree-1.8.7-2010.01%global/bin:/Users/amitava/.rvm/bin:$PATH"

exec "/Users/amitava/.rvm/rubies/ree-1.8.7-2010.01/bin/ruby" "$@"
=================================

Please note that both the shell scripts are setting up exactly the
same environment variables. Also, I am not pointing to the ruby
executable directly (/Users/amitava/.rvm/rubies/ruby-1.8.7-p174/bin/
ruby) but as recommended by rvm, at the wrapper script ~ /Users/
amitava/.rvm/bin/ruby-1.8.7-p174

In any case, I will try using rvm's ree (which includes
passenger_ruby) and report back.

amitava

unread,
Mar 17, 2010, 3:05:44 AM3/17/10
to Phusion Passenger Discussions
> In any case, I will try using rvm's ree (which includes
> passenger_ruby) and report back.

No luck.

For others trying to get ruby enterprise edition (ree) going in rvm,
the default version does not work. Please see the bug report at
http://code.google.com/p/rubyenterpriseedition/issues/detail?id=29#c5

As suggested in the bug report, I installed ree-1.8.7-2009.10

I have a hunch that passenger is linking another version of libiconv.

Here's the output from otool -L
--------------------------------
ashee-mac:passenger-2.2.11 amitava$ otool -L /Users/amitava/.rvm/gems/
ree-1.8.7-2009.10/gems/passenger-2.2.11/ext/apache2/mod_passenger.so
/Users/amitava/.rvm/gems/ree-1.8.7-2009.10/gems/passenger-2.2.11/ext/
apache2/mod_passenger.so:
/Applications/MAMP/Library/lib/libapr-0.0.dylib (compatibility
version 10.0.0, current version 10.17.0)
/Applications/MAMP/Library/lib/libaprutil-0.0.dylib (compatibility
version 10.0.0, current version 10.17.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 111.1.4)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current
version 7.4.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current
version 1.0.0)


And here's the output from otool against /Users/amitava/.rvm/rubies/
ree-1.8.7-2009.10/lib/ruby/site_ruby/1.8/i686-darwin9.8.0/iconv.bundle
(reported in apache error log)
-------------------------------------------
ashee-mac:passenger-2.2.11 amitava$ otool -L /Users/amitava/.rvm/
rubies/ree-1.8.7-2009.10/lib/ruby/site_ruby/1.8/i686-darwin9.8.0/
iconv.bundle
/Users/amitava/.rvm/rubies/ree-1.8.7-2009.10/lib/ruby/site_ruby/1.8/
i686-darwin9.8.0/iconv.bundle:
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current
version 7.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 111.1.4)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current
version 227.0.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current
version 1.0.0)

I am not sure what to do next. Any macosx guru out there?

-Amitava

Hongli Lai

unread,
Mar 17, 2010, 3:33:34 AM3/17/10
to phusion-...@googlegroups.com
On Wed, Mar 17, 2010 at 8:05 AM, amitava <amitav...@gmail.com> wrote:
> And here's the output from otool against /Users/amitava/.rvm/rubies/
> ree-1.8.7-2009.10/lib/ruby/site_ruby/1.8/i686-darwin9.8.0/iconv.bundle
> (reported in apache error log)
> -------------------------------------------
> ashee-mac:passenger-2.2.11 amitava$ otool -L /Users/amitava/.rvm/
> rubies/ree-1.8.7-2009.10/lib/ruby/site_ruby/1.8/i686-darwin9.8.0/
> iconv.bundle
> /Users/amitava/.rvm/rubies/ree-1.8.7-2009.10/lib/ruby/site_ruby/1.8/
> i686-darwin9.8.0/iconv.bundle:
>        /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current
> version 7.0.0)
>        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
> version 111.1.4)
>        /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current
> version 227.0.0)
>        /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current
> version 1.0.0)
>
> I am not sure what to do next. Any macosx guru out there?

It looks like iconv.bundle isn't linked to libiconv at all. This is
how it looks like for me:

$ otool -L /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/1.8/i686-darwin10.2.0/iconv.bundle
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/1.8/i686-darwin10.2.0/iconv.bundle:


/usr/lib/libiconv.2.dylib (compatibility version 7.0.0,
current version 7.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0,

current version 125.0.0)


/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current
version 227.0.0)

Try replacing your RVM's iconv.bundle with the one from the system
Ruby (/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0/iconv.bundle).

Do you have multiple iconv installations? If you type 'locate
libiconv.*.dylib' what do you see?

Wayne E. Seguin

unread,
Mar 17, 2010, 10:22:52 PM3/17/10
to phusion-...@googlegroups.com

amitava

unread,
Mar 18, 2010, 10:16:50 PM3/18/10
to Phusion Passenger Discussions
On Mar 17, 10:22 pm, "Wayne E. Seguin" <wayneeseg...@gmail.com> wrote:
> Additionally,
>
> http://rvm.beginrescueend.com/packages/iconv/
>
> ~Wayne


I got it to work now but after couple of twists. iconv was one of the
issue

1. To see what dylib's are being loaded, I added the following line on
top of ~/.rvm/passenger_ruby

export DYLD_INSERT_LIBRARIES=1

Now I can see the dylib's that the process is trying to load in my
apache error log

2. I can see that it is loading /Applications/MAMP/Library/lib/
libiconv.2.dylib and can't find the symbol _iconv_open
Let's see if _iconv_open is exported by MAMP's version of
libiconv.dylib

ashee-mac:~ amitava$ nm /Applications/MAMP/Library/lib/libiconv.dylib
| grep _iconv_open

Nope - no _iconv_open. Where is _iconv_open comming from? Let's see
what the system version has

ashee-mac:~ amitava$ nm /usr/lib/libiconv.dylib | grep _iconv_open
000150bd T _iconv_open

Bingo - so my ree-1.8.7-2009.10 is built against /usr/lib/
libiconv.dylib but at runtime getting MAMP's libconv.
But why does it think that libiconv has _iconv_open? Because /
Applications/MAMP/include/iconv.h does not exist and it is falling
back to /usr/include/iconv.h

ashee-mac:libiconv-1.13 amitava$ grep iconv_open /usr/include/iconv.h
from iconv_open().) */
iconv_t iconv_open (const char* /*tocode*/, const char* /*fromcode*/);


So let's use MAMP's iconv.h. I extracted MAMP_src/libiconv-1.13.tar.gz
and configured it

ashee-mac:libiconv-1.13 amitava$ ./configure --prefix=/Applications/
MAMP/Library

And copied MAMP_src/libiconv-1.13/include/iconv.h to /Applications/
MAMP/Library/include

3. Now install ree-1.8.7-2009.10 with
ashee-mac:~ amitava$ rvm install ree-1.8.7-2009.10 -C \
--with-readline-dir=$HOME/.rvm/usr,\
--with-iconv-dir=/Applications/MAMP/Library,\
--with-apx2=/Applications/MAMP/Library/bin/apxs,\
--with-openssl=/opt/local

At this point I get the following error
[Thu Mar 18 11:01:49 2010] [notice] Apache/2.0.63 (Unix) DAV/2 PHP/
5.2.11 Phusion_Passenger/2.2.11 configured -- resuming normal
operations
/Users/amitava/.rvm/rubies/ree-1.8.7-2009.10/lib/ruby/1.8/openssl/
ssl.rb:31: [BUG] Bus Error
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9.8.0], MBARI
0x8770, Ruby Enterprise Edition 2009.10

After a quick google search, I find this bug report and a workaround
therein
http://redmine.ruby-lang.org/issues/show/1678

After updating the said c source file, I have to manually run the
ree-1.8.7-2009.10 installer

ashee-mac:~ amitava$ cd ~/.rvm/src/ree-1.8.7-2009.10
ashee-mac:ree-1.8.7-2009.10 amitava$ ./installer -a /Users/
amitava/.rvm/rubies/ree-1.8.7-2009.10 --dont-install-useful-gems -c --
with-readline-dir=/Users/amitava/.rvm/usr -c --with-iconv-dir=/
Applications/MAMP/Library -c --with-apx2=/Applications/MAMP/Library/
bin/apxs -c --with-openssl-dir=/opt/local

Sucess at last!!

I would like to thank Hongli and Wayne for your guidance. I will
document and post the entire process in a few days.

-Amitava

amitava

unread,
Mar 18, 2010, 10:53:35 PM3/18/10
to Phusion Passenger Discussions
> top of ~/.rvm/passenger_ruby
>
> export DYLD_INSERT_LIBRARIES=1
>

Oops, typo!

export DYLD_PRINT_LIBRARIES=1

-Amitava

Reply all
Reply to author
Forward
0 new messages