Rails pg gem Incompatible library version

為{幸葍}努か 提交于 2019-12-03 06:45:58

Try:

$ gem install pg
$ gem pristine --all

It looks as if you might be suffering from this bug: https://bitbucket.org/ged/ruby-pg/issues/229/pg_exit-improperly-linked-when-using-rvm

The libruby version should be different, apparently.

However: I have the same error message, and my libruby is correct, so I think that there might be more going on...

I get the same error when I call in console rails c. Calling bundle exec rails c removed that error.

After looking at the discussion on https://bitbucket.org/ged/ruby-pg/issues/229/pg_ext-improperly-linked-when-using-rvm, the only way I've managed to make it work on Arch Linux was removing the system-wide ruby, then I did gem uninstall pg followed by gem install pg --version 0.18.3. This made the issue go away. I reinstalled the system-wide ruby after that. On my setup I had no packaged depending on the system-wide ruby, so it was okay to remove it, but YMMV.

I faced with this problem. I had ruby 2.2.1. I upgraded ruby to 2.3.3 and after it worked. Try this instruction:

rvm install ruby-2.3.3
rvm gemset empty
gem install bundler
bundle install
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!