Phusion white papers Phusion overview

Phusion Passenger 3.0.0 RC 1 released

By Hongli Lai on October 1st, 2010

This is it, the first Release Candidate (internally named “pre 4″). A few more bugs have been fixed since beta 3, but if no more serious bugs are found then the next release will be 3.0.0 final.

What’s new

Autodetection of Ruby tool commands now take exe extension, –program-prefix and –program-suffix into account

Phusion Passenger had a pretty elaborate way of searching the system for Ruby tool commands like ‘gem’, ‘rake’, etc. The reason why all this search code exists is because the problem is much more complicated than just searching for “rake” in $PATH. A significant number of people have multiple Ruby versions installed on their system; let’s call these Ruby A and Ruby B. They run the Phusion Passenger installer with Ruby A and they installed the required gems with Ruby A’s RubyGems, but they have a Rake in $PATH that belongs to Ruby B. If we were to naively use the Rake in $PATH then the wrong Rake will be invoked and they would wonder why the gems they just installed aren’t detected. Our Ruby tool search code tries very hard to find the Rake that belongs to the Ruby interpreter that’s currently running.

However the code didn’t take the exe extension into consideration, as well as the –program-prefix and –program-suffix that Ruby could be configured with. For example, on some systems the Ruby command is called “ruby1.8″ and Rake is called “rake1.8″. Similarly, the default JRuby binary distribution calls Rake “jrake”. We’ve now updated our search code to take this into account as well. Issue #537.

Usability and ease of installation remains to be one of our biggest goals. As you can see we’ve gone through great lengths to make sure that everything works as expected and that everything is as fool-proof as possible, even if the system might not be entirely correctly configured.

Fixed linking problems on some systems
Phusion Passenger uses math functions such as pow(). On some systems — .e.g. NetBSD, some versions of Solaris and some Linux distros — this requires Phusion Passenger to be linked to the Math library. Issue #539.
Phusion Passenger Standalone fix
When Phusion Passenger Standalone is daemonized with -d, it exits with a non-zero exit code. This has been fixed. Issue #536.
Preferred PCRE version upgraded to version 8.10
passenger-install-nginx-module automatically installs PCRE for you in case you didn’t already have it.

Installation/upgrade

First install the latest Phusion Passenger gem:

gem install passenger --pre

(Or you can download the tarball.)

If you want to install or upgrade the Apache or Nginx version, then run the installer as you’re used to:

passenger-install-apache2-module
passenger-install-nginx-module

At the end the installer will tell you to paste a configuration snippet. If you’re upgrading then replace the old snippet with the new one.

If you want to run Phusion Passenger Standalone, then run:

cd /path-to-your-app
passenger start

No special upgrade instructions needed.

The documentation

Users guide for Apache
Users guide for Nginx
Users guide for Standalone

  • Oleh

    Great work guys!

  • http://webapart.be Geoff

    Great work!
    I switched to passenger 3 in production for all my apps and everything is working just fine and faster than ever.
    Thank you guys for the great work!

    Geoff

  • Walter Souto

    I see that the nginx version still 0.7.67 by default. I was expecting that nginx’s version gets bumped to 0.8.52… But we can always set –nginx-version :)

  • http://www.phusion.nl/ Hongli Lai

    An I didn’t see that 0.8 has now become the stable series.

  • tester

    Works well with rails2 apps, but it’s still not straight forward with rails3/bundler

    Gems are not found without config/setup_load_paths.rb
    *** Exception PhusionPassenger::UnknownError in PhusionPassenger::Rack::ApplicationSpawner (Could not find activesupport-3.0.0 in any of the sources (Bundler::GemNotFound))

    and with ENV['BUNDLE_PATH'], passenger just crashes:

    [notice] child pid 45571 exit signal Bus error (10)

  • tester

    That’s with Apache2

  • http://www.phusion.nl/ Hongli Lai

    @tester: Rails3+Bundler is supposed to be fully supported. Can you post a bug report with more details? I’d like to see a backtrace.

  • http://intridea.com Jonathan Nelson

    awesome work guys! was able to upgrade in < 5 minutes flawlessly. blazing blazing fast too :)))

  • tester

    I’ll try to fill in a bug report.
    Here is what I saw in the backtrace. Apache2 on FreeBSD

    (gdb) bt full
    #0 0x0000000800aeaa7a in sem_init () from /lib/libthr.so.3
    No symbol table info available.
    #1 0x000000080144cee2 in __do_global_ctors_aux () from /usr/local/lib/gcc45/libgomp.so.1
    No symbol table info available.
    #2 0x000000080144515e in _init () from /usr/local/lib/gcc45/libgomp.so.1
    No symbol table info available.
    #3 0x00000008006441b0 in ?? () from /libexec/ld-elf.so.1
    No symbol table info available.
    #4 0x000000080051cc49 in dlsym () from /libexec/ld-elf.so.1
    No symbol table info available.
    #5 0x000000080051d55e in dlopen () from /libexec/ld-elf.so.1
    No symbol table info available.
    #6 0x00000008009a5016 in apr_dso_load (res_handle=0x7fffffffde18, path=Variable “path” is not available.
    ) at dso/unix/dso.c:139
    os_handle = Variable “os_handle” is not available.

  • tester

    Getting rid of mod_dav_svn.so now gives me the full passenger crash report (rails3 app related).
    So maybe there was an incompatibility there…

  • Pingback: Link dump for October 1st | The Queue Blog

  • Peterlih

    Nice work! And it is so fast … Unfortunately we are getting a Stack Level too deep exception random times, when loading our app in browser. Quite strange because routing in the Rails App is done and IT happens After that. hoptoad is not notified. But seemingly it is not an app exception because it is running in other environments … We try to find the reason and report it back then …

  • BillH

    I am using latest rvm, ruby 1.9.2-p0 and rails3. At first I was getting errors about not being able to load gems, and I did bundle install –deployment, and now I’m getting: “Could not find rake-0.8.7 in any of the sources (Bundler::GemNotFound)” and somewhat odd, I’m seeing references to r 1.8.7 in the trace following

  • BillH

    doh; figured it out. I introduced an error updating the httpd.conf changes; fixed it and all is well.

  • http://www.ingamer.com/ Simon

    With your 2.2.9 release you suggested that it is better to remove config.ru instead of setting RackEnv.

    Is this still the case?

    If you’re using ruby 1.9.2?

  • http://www.karmacrm.com John Paul Narowski

    Nice work guys! I really love using Passenger! How does Phusion Passenger 3.0.0 RC 1 play with Ruby 1.9.2. Any idea when the full release will be?

  • http://www.phusion.nl/ Hongli Lai

    @Simon: No, keep config.ru now.

    @John: Ruby 1.9 has been supported for more than a year now. Passenger 3 still supports it.

  • http://betterlogic.com/roger roger

    Keep up the good work.

  • Matt A.

    Trying passenger (3.0.0.pre4) with a rails 2.3.8 app on ruby 1.9.2.
    We are using authlogic (2.1.6) to login into our administration area and it fails.
    But using the thin server it works fine. BTW, There is no problem with ruby 1.8.7.

    I checked old post about session conflict between authlogic and passenger and made sure that we are using active_record_store. Included is the log.

    Any ideas? thx.

    /!\ FAILSAFE /!\ 10/07/2010
    Status: 500 Internal Server Error
    can’t convert nil into Integer
    /Users/mha/netbeans/25karats/vendor/plugins/attachment_fu/init.rb:7:in `sprintf’
    /Users/mha/netbeans/25karats/vendor/plugins/attachment_fu/init.rb:7:in `make_tmpname’
    /opt/ruby-1.9.2/lib/ruby/1.9.1/tmpdir.rb:132:in `create’
    /opt/ruby-1.9.2/lib/ruby/1.9.1/tempfile.rb:134:in `initialize’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/utils/rewindable_input.rb:86:in `new’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/utils/rewindable_input.rb:86:in `make_rewindable’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/utils/rewindable_input.rb:30:in `read’
    /opt/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/request.rb:147:in `POST’
    /opt/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/methodoverride.rb:15:in `call’
    /opt/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/actionpack-2.3.8/lib/action_controller/params_parser.rb:15:in `call’
    /opt/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/actionpack-2.3.8/lib/action_controller/session/abstract_store.rb:128:in `call’
    /opt/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:29:in `block in call’
    /opt/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache’
    /opt/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:9:in `cache’
    /opt/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/activerecord-2.3.8/lib/active_record/query_cache.rb:28:in `call’
    /opt/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call’
    /opt/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/cache/strategy/local_cache.rb:25:in `call’
    /opt/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/actionpack-2.3.8/lib/action_controller/failsafe.rb:26:in `call’
    /opt/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/lock.rb:11:in `block in call’
    :10:in `synchronize’
    /opt/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call’
    /opt/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:114:in `block in call’
    /opt/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/actionpack-2.3.8/lib/action_controller/reloader.rb:34:in `run’
    /opt/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:108:in `call’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `block in handle_spawn_application’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/utils.rb:479:in `safe_fork’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/abstract_server.rb:180:in `start’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/spawn_manager.rb:219:in `block (2 levels) in spawn_rails_application’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/spawn_manager.rb:214:in `block in spawn_rails_application’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize’
    :10:in `synchronize’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously’
    /Users/mha/.passenger/standalone/3.0.0.pre4-x86_64-ruby1.9.2-macosx-10.6/support/helper-scripts/passenger-spawn-server:99:in `’

  • Sam

    Passenger 3 is great, I am looking forward to the full release. When will it be?

    nginx-0.8.52 stable version has been released. Will passenger use nginx 0.8.52 anytime soon?

  • http://www.phusion.nl/ Hongli Lai

    @Matt: According to the backtrace you’re still on Ruby 1.9.1.

  • http://betterlogic.com/roger roger

    @Matt @Hongli I think he’s on 1.9.2, the libdir for 1.9.2 is (confusingly) still 1.9.1

  • Matt A.

    @Hongli, I recompiled ruby1.9.2 but as @roger said, the ruby lib is still 1.9.1.
    and the above problem still exist. At this time we decided to wait on a 1.9.2 version of the ruby enterprise whenever that may be…

  • Weldys Santos

    Hi, I have had a problem when I compile passenger3 in rvm, with ruby 1.9.2-p0. When compile it, an error happen with no explication. Follow the output:

    g++ -Iext -Iext/common -fPIC -fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED -Wno-attributes -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -DLINUX=2 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/openssl -I/usr/include/xmltok -pthread -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -DHASH_NAMESPACE=”__gnu_cxx” -DHASH_NAMESPACE=”__gnu_cxx” -DHASH_FUN_H=”" -Wall -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -o ext/apache2/Hooks.o -c ext/apache2/Hooks.cpp
    g++: Internal error: Killed (program cc1plus)
    Please submit a full bug report.
    See for instructions.
    rake aborted!
    Command failed with status (1): [g++ -Iext -Iext/common -fPIC -fvisibility=...]

    (See full trace by running task with –trace)

    ——————————————–

    It looks like something went wrong

    Please read our Users guide for troubleshooting tips:

    /home/weldyss/.rvm/gems/ruby-1.9.2-p0@formaturas/gems/passenger-3.0.0.pre4/doc/Users guide Apache.html

    If that doesn’t help, please use our support facilities at:

    http://www.modrails.com/

    We’ll do our best to help you.

    Any ideia? :\

  • http://www.phusion.nl/ Hongli Lai

    @Weldys: The compiler crashed. You should submit a bug report to your OS vendor or to the compiler authors.

    More likely, the crash is caused by bad RAM.

  • Patrick

    @Matt I ran into the exact same problem you did.

    In /opt/ruby-1.9.2/lib/ruby/1.9.1/tmpdir.rb:132 we see the offending code:
    ——–
    #n = nil <— causes make_tmpname call to crash!
    n = 0 <— fix
    begin
    path = File.expand_path(make_tmpname(basename, n), tmpdir)
    yield(path, n, *opts)
    rescue Errno::EEXIST
    n ||= 0
    n += 1
    retry if !max_try or n < max_try
    raise "cannot generate temporary name using `#{basename}' under `#{tmpdir}'"
    end
    ——–

  • Patrick

    @Matt
    The alternate solution is not to modify the ruby lib but the class that is overriding make_tmpname(). In my case attachment_fu is doing the overriding. The offending code is this:

    def make_tmpname(basename, n)
    ext = nil
    sprintf(“%s%d-%d%s”, basename.to_s.gsub(/\.\w+$/) { |s| ext = s; ” }, $$, n, ext)
    end

    If I changed n to n.to_i that would probably fix the problem.

    See this:
    http://stackoverflow.com/questions/2483243/paperclip-and-tempfile-with-rails

  • Pingback: Passenger not booting Rails App - Question Lounge