【问题标题】:Rails LoadError with openssl.so: undefined symbol: d2i_ECPKParameters带有 openssl.so 的 Rails LoadError:未定义符号:d2i_ECPKParameters
【发布时间】:2013-09-24 05:39:18
【问题描述】:

rails --version

Rails 3.2.1

红宝石-v

ruby 1.9.3p0 (2011-10-30) [x86_64-linux]

rpm -qa | grep openssl

openssl-0.9.8e-20.el5 openssl-devel-0.9.8e-20.el5 openssl-0.9.8e-20.el5

uname -a

Linux 2.6.18-274.7.1.el5 #1 SMP Mon Oct 17 11:57:14 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

rails 新博客

  create  
  create  README.rdoc
  create  Rakefile
  create  config.ru
  create  .gitignore
  create  Gemfile
  create  app
  create  app/assets/images/rails.png
  create  app/assets/javascripts/application.js
  create  app/assets/stylesheets/application.css
  create  app/controllers/application_controller.rb
  create  app/helpers/application_helper.rb
  create  app/mailers
  create  app/models
  create  app/views/layouts/application.html.erb
  create  app/mailers/.gitkeep
  create  app/models/.gitkeep
  create  config
  create  config/routes.rb
  create  config/application.rb
  create  config/environment.rb
  create  config/environments
  create  config/environments/development.rb
  create  config/environments/production.rb
  create  config/environments/test.rb
  create  config/initializers
  create  config/initializers/backtrace_silencers.rb
  create  config/initializers/inflections.rb
  create  config/initializers/mime_types.rb
  create  config/initializers/secret_token.rb
  create  config/initializers/session_store.rb
  create  config/initializers/wrap_parameters.rb
  create  config/locales
  create  config/locales/en.yml
  create  config/boot.rb
  create  config/database.yml
  create  db
  create  db/seeds.rb
  create  doc
  create  doc/README_FOR_APP
  create  lib
  create  lib/tasks
  create  lib/tasks/.gitkeep
  create  lib/assets
  create  lib/assets/.gitkeep
  create  log
  create  log/.gitkeep
  create  public
  create  public/404.html
  create  public/422.html
  create  public/500.html
  create  public/favicon.ico
  create  public/index.html
  create  public/robots.txt
  create  script
  create  script/rails
  create  test/fixtures
  create  test/fixtures/.gitkeep
  create  test/functional
  create  test/functional/.gitkeep
  create  test/integration
  create  test/integration/.gitkeep
  create  test/unit
  create  test/unit/.gitkeep
  create  test/performance/browsing_test.rb
  create  test/test_helper.rb
  create  tmp/cache
  create  tmp/cache/assets
  create  vendor/assets/javascripts
  create  vendor/assets/javascripts/.gitkeep
  create  vendor/assets/stylesheets
  create  vendor/assets/stylesheets/.gitkeep
  create  vendor/plugins
  create  vendor/plugins/.gitkeep
     run  bundle install
/usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': /usr/local/lib/ruby/1.9.1/x86_64-linux/openssl.so: undefined symbol: d2i_ECPKParameters - /usr/local/lib/ruby/1.9.1/x86_64-linux/openssl.so (LoadError)
    from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/lib/ruby/1.9.1/openssl.rb:17:in `<top (required)>'
    from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/lib/ruby/1.9.1/net/https.rb:22:in `<top (required)>'
    from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/lib/ruby/1.9.1/rubygems/remote_fetcher.rb:316:in `connection_for'
    from /usr/local/lib/ruby/1.9.1/rubygems/remote_fetcher.rb:368:in `request'
    from /usr/local/lib/ruby/1.9.1/rubygems/remote_fetcher.rb:203:in `fetch_http'
    from /usr/local/lib/ruby/1.9.1/rubygems/remote_fetcher.rb:231:in `fetch_path'
    from /usr/local/lib/ruby/1.9.1/rubygems/spec_fetcher.rb:265:in `load_specs'
    from /usr/local/lib/ruby/1.9.1/rubygems/spec_fetcher.rb:231:in `block in list'
    from /usr/local/lib/ruby/1.9.1/rubygems/spec_fetcher.rb:227:in `each'
    from /usr/local/lib/ruby/1.9.1/rubygems/spec_fetcher.rb:227:in `list'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/source.rb:253:in `fetch_all_remote_specs'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/source.rb:234:in `block in remote_specs'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/source.rb:231:in `each'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/source.rb:231:in `remote_specs'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/source.rb:165:in `fetch_specs'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/source.rb:70:in `specs'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/definition.rb:176:in `block (2 levels) in index'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/definition.rb:175:in `each'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/definition.rb:175:in `block in index'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/index.rb:7:in `build'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/definition.rb:174:in `index'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/definition.rb:168:in `resolve'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/definition.rb:107:in `specs'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/definition.rb:102:in `resolve_remotely!'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/installer.rb:43:in `run'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/installer.rb:8:in `install'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/cli.rb:219:in `install'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/vendor/thor.rb:263:in `dispatch'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/vendor/thor/base.rb:386:in `start'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/bin/bundle:13:in `<main>'
Fetching source index for https://rubygems.org/

【问题讨论】:

    标签: ruby-on-rails openssl


    【解决方案1】:

    如果您在安装 ruby​​ 之前没有安装 openssl,则会出现此问题。有两个修复:

    1. (建议修复)安装 openssl,然后重新编译您的 ruby​​ 版本。假设您使用的是 rvm,您可以通过执行以下操作来解决此问题:rvm pkg install openssl 然后 rvm remove 1.9.3 然后 rvm install 1.9.3 --with-openssl-dir=$HOME/.rvm/usr 使用 openssl 编译 ruby​​。

    2. 将您的 Gemfile 修改为 source "http://rubygems.org" 而不是 source "https://rubygems.org"

    选项 2 更快更容易,但更可能在未来引起问题。

    【讨论】:

      【解决方案2】:

      rvm pkg 已被弃用。

      如果您运行的是最新版本的 rvm(例如 1.21),请尝试此操作:

      rvm autolibs enable
      rvm reinstall <ruby>
      

      &lt;ruby&gt; 是您使用的 ruby​​ 版本。 (例如 rvm 重新安装 1.9.3)

      重新安装 ruby​​ 后,检查 .ruby-version 文件(替换 rvm 最新版本中的 .rvmrc)并确保将其设置为新版本的 ruby​​。

      在一切正常之前,我最终移除了 gemset 并重新创建它。

      【讨论】:

        【解决方案3】:

        我遇到了同样的问题,但环境不同。默认情况下已经安装了 Openssl 工具。默认情况下,Ruby 1.9.2p320 也安装在 /usr/local 中,我使用 rbenv 在自定义位置安装其他 rubies。将 Rails 与 rbenv 的 ruby​​ 1.8.7 及其 openssl 一起使用会产生未定义的符号:d2i_ECPKParameters 错误。

        为了修复它,我覆盖了我的系统默认 ruby​​ 并将 ruby​​ 1.8.7 安装到 /usr/local 并安装了它的 通过:

        # after installing ruby 1.8.7 to /usr/local
        # make sure the recent install ruby 1.8.7 is the default ruby
        cd ruby-1.8.7-pXXX/ext/openssl
        ruby extconf.rb
        make
        make install
        

        然后我创建了一个符号链接,从 /usr/local 中最近安装的 openssl.so 到我的 rbenv 的 ruby 1.8.7的lib/ruby/site_ruby/1.8/x86_64-linux/openssl.so

        Rails 启动后不再出现 d2i_ECPKParameters 错误。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2020-02-26
          • 2011-09-20
          • 2023-04-10
          • 2018-08-02
          • 1970-01-01
          • 2017-03-23
          • 2016-03-14
          相关资源
          最近更新 更多