5

Lately I moved from RVM to Rbenv. I run a bunch of different rails applications (each has a different ruby version) with passenger and nginx. However, I get an error for two applications when trying to load them:

/user_folder/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': incompatible library version - /usr/local/Cellar/passenger/6.0.2_1/libexec/buildout/ruby/ruby-2.3.3-x86_64-macosx/passenger_native_support.bundle (fatal)
    from /user_folder/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Cellar/passenger/6.0.2_1/libexec/src/ruby_supportlib/phusion_passenger/native_support.rb:427:in `load_native_extension'
    from /usr/local/Cellar/passenger/6.0.2_1/libexec/src/ruby_supportlib/phusion_passenger/native_support.rb:103:in `load_from_buildout_dir'
    from /usr/local/Cellar/passenger/6.0.2_1/libexec/src/ruby_supportlib/phusion_passenger/native_support.rb:39:in `try_load'
    from /usr/local/Cellar/passenger/6.0.2_1/libexec/src/ruby_supportlib/phusion_passenger/native_support.rb:50:in `start'
    from /usr/local/Cellar/passenger/6.0.2_1/libexec/src/ruby_supportlib/phusion_passenger/native_support.rb:443:in `<top (required)>'

Other apps are working fine, and those work when I use webrick (standalone) instead. But for some reason, I have issues when doing so with passenger.

I'm not sure whether it's a coincidence or not, but both apps I have issues with are running ruby v2.3.3.

Any idea on what's happening?

ascherman
  • 1,602
  • 2
  • 17
  • 34
  • 1
    did you re-installed the ruby gems after switching to `rbenv`? Above issue may have raised due to mismatch of ruby `gemset` path. – uday Apr 22 '19 at 07:15
  • @UdAY I actually run a `gem pristine --all`. However, after all of this, I remove rbenv and got back to rvm and the issue persists. So that doesn't seem to be related to the ruby version manager at all. Any thoughts? – ascherman Apr 22 '19 at 16:56

2 Answers2

0

you should remove rvm

This post explains how to remove rvm, additionally there is a dangerous, but yet effective rvm implode script.

The output you are receiving is not from rbenv but rvm.

build-native-support. [passenger_native_support.bundle] trying to compile for the current user and Ruby interpreter... (set PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 to disable) Compilation successful. The logs are here: /var/folders/_n/pb7r0l3x4kjgcvbdxj30nyn00000gn/T/passenger_native_support-142p5a1.log [passenger_native_support.bundle] successfully loaded.

This could be caused from different issues, I would go through the whole procedure of rvm removal and rbenv installation.

rbenv and rvm use an environment variable to intercept your commands.

You don't have a passenger or passenger-config binary in your system $PATH (which is a list of folders in your home directory), the passenger binaries are installed from rbenv and stored inside the .rbenv/<ruby-version> folder.

Each version of ruby has separate dependencies.

rbenv intercepts your commands (passenger-config) and run the correct binary (.rbenv/<ruby-version>/gems/passenger/passenger-config) based on the ruby-version you set up either globally or locally.

rvm probably works with a similar methodology and it is incompatible with rbenv.

For this reason you need to check your ~/.bash_profile, ~/.bashrc or any other terminal config profile settings for the rvm env variables and remove them.

Once you correctly installed rbenv, run a command line interface command passenger-config

passenger-config build-native-support

and also consider checking out Passenger + Nginx installation instructions.

Fabrizio Bertoglio
  • 5,555
  • 3
  • 13
  • 47
  • This didn't work for me. And I need passenger to run with Nginx, I'm not interested in the standalone version. Thanks though! – ascherman Apr 23 '19 at 20:16
  • @ArielScherman [passenger with nginx installation instructions](https://www.phusionpassenger.com/docs/tutorials/installation/ruby/), once you installed the gem, `passenger-config` should be available globally in your terminal and you can run `build-native-support`. Please output the result of running those commands – Fabrizio Bertoglio Apr 24 '19 at 06:51
  • I've tried that and I got this message when running the `build-native-support`. `[passenger_native_support.bundle] trying to compile for the current user and Ruby interpreter... (set PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 to disable) Compilation successful. The logs are here: /var/folders/_n/pb7r0l3x4kjgcvbdxj30nyn00000gn/T/passenger_native_support-142p5a1.log [passenger_native_support.bundle] successfully loaded.` However, it still doesn't work (I've restarted everything)) – ascherman Apr 27 '19 at 00:52
  • @ArielScherman your issues is caused from not correctly removing `rvm` and updating your `bash_profile` environment variables. I update my answer – Fabrizio Bertoglio Apr 27 '19 at 08:59
-2

Something's corrupted in your ruby 2.3.3 environment.

Try 'gem uninstall passenger', follow prompts to uninstall ALL versions(if any). Then install passenger gem. Then hopefully you'll be able to get rid of this issue.

Just to ensure, make sure that you have set the passenger_ruby to 2.3.3 path at corresponding virtual host entry.

Jacs
  • 115
  • 1
  • 1
  • 9
  • Thanks, but it's not working. The `passenger_ruby` is set correctly to 2.3.3. I have another project with a different ruby version that is working fine, the problem seems to be only for projects with ruby 2.3.3. Any ideas? – ascherman Apr 27 '19 at 00:55