运行 Rails 应用程序时出错,不兼容的库版本 rgeo proj4。

4
当我运行foreman start时,我会得到这个错误:
 ~/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require': incompatible library version - ~/.rvm/gems/ruby-2.2.3/gems/rgeo-0.4.0/lib/rgeo/coord_sys/proj4_c_impl.bundle (fatal)
        from ~/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require'
        from ~/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
        from ~/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
        from ~/.rvm/gems/ruby-2.2.3/gems/rgeo-0.4.0/lib/rgeo/coord_sys.rb:39:in `<top (required)>'

我已经尝试过 rvm gemset empty && bundle installgem uninstall rgeo && gem install rgeo,但这些方法都没有解决问题。其他人在同一项目上工作时并没有遇到这个问题。
我使用的版本是:Ruby 2.2.3p173Rails 4.2.4Gem 2.4.8。请问我做错了什么?
1个回答

2
我也遇到了这个问题。我需要更多了解您的环境,但可能与我今天向RGeo项目报告的此问题有关:https://github.com/rgeo/rgeo/issues/114 如果您使用Homebrew版本的Ruby,则可能需要卸载它并使用RVM。当两者同时运行时似乎会发生冲突。
我还提交了一个补丁,可能适用于您。它基本上确保如果您使用Ruby Manager,则RGeo首先尝试使用这些库进行构建。您可以在此处查看该代码:https://github.com/eddietejeda/rgeo/tree/prioritize_ruby_manager_lib 您可以将其添加到Gemfile中进行测试: gem 'rgeo',:git => 'git@github.com:eddietejeda/rgeo.git',:branch => 'prioritize_ruby_manager_lib' 希望能对您有所帮助!

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接