4

I have been having an issuing loading my app. I built it in an older version of rails and a few months back upgraded my rails to 5.0.7.2 With ruby 2.5.1p57. I'm using Homebrew with chruby.

I'm using 'pg', '~> 0.18'

When I start my app in terminal I get the following error.

from /Users/MyName/.gem/ruby/2.5.1/gems/pg-0.21.0/lib/pg.rb:4:in <top (required)>' /Users/MyName/.gem/ruby/2.5.1/gems/pg-0.21.0/lib/pg.rb:4:inrequire': incompatible library version - /Users/MyName/.gem/ruby/2.5.1/gems/pg-0.21.0/lib/pg_ext.bundle (LoadError)

I have tried a few directions but it takes me down a path where It breaks things and I end up here again. Can someone give me some direction?

Tried gem pristine --all - now I'm getting a new issue. Thoughts?

> Joshuas-iMac:reviewbox2 JoshuaRinard$ gem pristine --all Ignoring
> childprocess-2.0.0 because its extensions are not built. Try: gem
> pristine childprocess --version 2.0.0 Ignoring ffi-1.9.23 because its
> extensions are not built. Try: gem pristine ffi --version 1.9.23
> Ignoring msgpack-1.2.4 because its extensions are not built. Try: gem
> pristine msgpack --version 1.2.4 Ignoring sqlite3-1.4.1 because its
> extensions are not built. Try: gem pristine sqlite3 --version 1.4.1
> Ignoring websocket-driver-0.7.0 because its extensions are not built.
> Try: gem pristine websocket-driver --version 0.7.0 ERROR:  Loading
> command: pristine (LoadError)
>   dlopen(/Users/JoshuaRinard/.rubies/ruby-2.5.1/lib/ruby/2.5.0/x86_64-darwin17/openssl.bundle,
> 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib 
> Referenced from:
> /Users/JoshuaRinard/.rubies/ruby-2.5.1/lib/ruby/2.5.0/x86_64-darwin17/openssl.bundle
> Reason: image not found -
> /Users/JoshuaRinard/.rubies/ruby-2.5.1/lib/ruby/2.5.0/x86_64-darwin17/openssl.bundle
> ERROR:  While executing gem ... (NoMethodError)
>     undefined method `invoke_with_build_args' for nil:NilClass
Jrinard
  • 165
  • 1
  • 14
  • Does `bundle install` in the top directory of your app work without issues? If bundle throws any errors I would start there. Additionally, for upgrading rails apps, I would review the [Upgrading Ruby on Rails Guide](https://guides.rubyonrails.org/upgrading_ruby_on_rails.html) for more insights – Steven Foster Feb 15 '20 at 01:43
  • bundle install gives no issues. I have had it working for some time before the error happened when mac osx updated to Mojave 10.14.16 which started me down a path of trying to fix things that broke further. – Jrinard Feb 15 '20 at 01:45
  • 3
    Try `gem pristine --all`, it rebuilds native extensions, among other things. If that works, we might want to mark this as a duplicate of https://stackoverflow.com/questions/33809990/rails-pg-gem-incompatible-library-version – Jared Beck Feb 15 '20 at 02:40
  • 2
    openssl has always been problematic on OS-X as Apple uses its own version of the library. Usually the solution is to install openssl via homebrew or use the `--use-system-libraries` option. – max Feb 15 '20 at 13:33
  • The short version is I ended up installing rvm then with the app gems isolated I had to upgrade my postgres database. App is loading because I fixed the problem or just moved somewhere else. – Jrinard Feb 21 '20 at 01:25

0 Answers0