Thursday, October 16, 2014

Phusion Passenger and missing passenger_native_support.so issue

When upgrade an Rails application from Ruby 1.9.3 to 2.0.0 by using rvm, it throws out error as:

Raw process output:

 --> Compiling passenger_native_support.so for the current Ruby interpreter...
     (set PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 to disable)
 --> Downloading precompiled passenger_native_support.so for the current Ruby interpreter...
     (set PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY=0 to disable)
     Could not download https://oss-binaries.phusionpassenger.com/binaries/passenger/by_release/4.0.48/rubyext-ruby-2.0.0-x86_64-linux.tar.gz: Resolving timed out after 4516 milliseconds
     Trying next mirror...
     Could not download https://s3.amazonaws.com/phusion-passenger/binaries/passenger/by_release/4.0.48/rubyext-ruby-2.0.0-x86_64-linux.tar.gz: Resolving timed out after 4516 milliseconds
 --> Continuing without passenger_native_support.so.
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/json-1.8.1/lib/json/common.rb:67: [BUG] Segmentation fault
ruby 2.0.0p451 (2014-02-24 revision 45167) [x86_64-linux]

It turned out the passenger_native_support.so was missed in rvm /usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/x86_64-linux/ folder.

So searched and found it in /usr/lib/ruby/2.0.0/x86_64-linux-gnu/ then copied it to /usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/x86_64-linux/

13 comments:

  1. Can I know how you solve this problem. This bothers me for so long...

    ReplyDelete
    Replies
    1. Tag,
      Can you search passenger_native_support.so if it existed in somewhere? On my server, it's under /usr/lib/ruby/2.0.0/x86_64-linux-gnu/ , then we'll need to copy it over the /usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/x86_64-linux/

      Delete
  2. My ruby is 2.3 and compile from tgz file myself. And my passenger is installed via yum (official repo) in CentOS7.2
    So it's not going to work on mine. Do you have any idea about this?

    ReplyDelete
    Replies
    1. I've setup ruby 2.0.0 with rvm and passenger from its repo on a Ubuntu box. We should look into the log to see detail errors.

      Delete
  3. It's weird. It works well if I choose the method 'gem install passenger; passenger-install-nginx-module'. But if fails using yum repo.
    I don't really prefer passenger-install-nginx-module, because it will not be easy to prepare server to me... :'(

    ReplyDelete
  4. Thanks for your reply. These are my logs. please let me know if you have any idea.
    https://twitter.com/charlie_hsieh/status/720469118621741057

    ReplyDelete
    Replies
    1. can you post the text content here? I can't read them in your screenshot

      Delete
    2. let's find out where passenger_native_support.so locates and copy over to the current ruby lib

      Delete
  5. It took me 1 week every night.. tried every location, every permision...
    ... ha... give up on yum.... I like to manage service by systemd though..... :'(
    I'm gonna be back to commom way in gem install passenger && passenger-install-nginx-module.
    and write systemd via sample https://www.nginx.com/resources/wiki/start/topics/examples/systemd/
    Thanks for your kindly help...

    if you ever try to install passenger via apt-get or yum though phusion official please share with me. Thanks a lot :)

    ReplyDelete


  6. I copy from my old Ansible roles here:

    passenger_repo: 'deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main'


    - name: Check Phusion Passenger APT repository is installed
    stat: path=/etc/apt/sources.list.d/passenger.list
    register: passenger_list_path
    when: passenger_repo is defined and ansible_os_family == "Debian"

    - name: Setup Phusion Passenger
    #Ref: https://www.phusionpassenger.com/documentation/Users%20guide%20Apache.html#install_on_debian_ubuntu
    shell: "{{item}}"
    with_items:
    # Setup Phusion Passenger APT repository
    - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7
    - apt-get -y install apt-transport-https ca-certificates
    - "echo {{passenger_repo}} > /etc/apt/sources.list.d/passenger.list"
    - "chown root:root /etc/apt/sources.list.d/passenger.list"
    - chmod 600 /etc/apt/sources.list.d/passenger.list
    - apt-get -y update
    when: passenger_repo is defined and ansible_os_family == "Debian" and not passenger_list_path.stat.exists

    - name: Make sure libapache2-mod-passenger is installed (Debian)
    apt: pkg=libapache2-mod-passenger state=present
    when: passenger_repo is defined and ansible_os_family == "Debian" and not passenger_list_path.stat.exists

    - name: Enable the Phusion Passenger Apache module
    command: a2enmod passenger
    when: passenger_repo is defined and ansible_os_family == "Debian" and not passenger_list_path.stat.exists
    if rvm is installed
    stat: path=/usr/local/rvm/scripts/rvm
    register: rvm_path
    - name: Setup rvm
    shell: "{{item}}"
    with_items:
    - \curl -sSL https://get.rvm.io | bash -s stable --rails
    - chmod 755 /usr/local/rvm/scripts/rvm && /usr/local/rvm/scripts/rvm
    - /usr/local/rvm/bin/rvm install 2.0.0-p451 --disable-binary
    - cp /usr/lib/ruby/2.0.0/x86_64-linux-gnu/passenger_native_support.so /usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/x86_64-linux/passenger_native_support.so
    - /usr/local/rvm/bin/rvm use ruby-2.0.0-p451
    when: not rvm_path.stat.exists

    I think I missed the command : passenger-config build-native-support
    in the tasks, see this
    http://stackoverflow.com/questions/35869809/compile-passenger-native-support-with-rvm-for-different-ruby-versions

    Not tried on Centos yet, but if possible, give me access to your server to troubleshoot.










    ReplyDelete
  7. Really! Yes, it's possible. Just how do we do that?
    It would be a big thank you!

    ReplyDelete
  8. Or I can add you whatsapp , line , or something like that ?

    ReplyDelete
  9. contact me via
    https://docs.google.com/forms/d/1LMmZ9NapaIG-YKYc3kWwmvV9kkGC6m3nydCzDl5e0ZM/viewform

    ReplyDelete