0

创建新的 Rails 应用程序时出现此错误

<internal:lib/rubygems/custom_require>:29:in `require': libcrypto.so.0.9.8: cannot open shared object file: No such file or directory - /share/Ruby/192p290/lib/ruby/1.9.1/armv5tel-linux-eabi/digest/md5.so (LoadError)
  from <internal:lib/rubygems/custom_require>:29:in `require'
  from /share/Ruby/192p290/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/generators/rails/app/app_generator.rb:1:in `<top (required)>'
  from <internal:lib/rubygems/custom_require>:29:in `require'
  from <internal:lib/rubygems/custom_require>:29:in `require'
  from /share/Ruby/192p290/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/commands/application.rb:16:in `<top (required)>'
  from <internal:lib/rubygems/custom_require>:29:in `require'
  from <internal:lib/rubygems/custom_require>:29:in `require'
  from /share/Ruby/192p290/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/cli.rb:14:in `<top (required)>'
  from <internal:lib/rubygems/custom_require>:29:in `require'
  from <internal:lib/rubygems/custom_require>:29:in `require'
  from /share/Ruby/192p290/lib/ruby/gems/1.9.1/gems/rails-3.0.9/bin/rails:8:in `rescue in <top (required)>'
  from /share/Ruby/192p290/lib/ruby/gems/1.9.1/gems/rails-3.0.9/bin/rails:3:in `<top (required)>'
  from /share/Ruby/192p290/bin/rails:19:in `load'
  from /share/Ruby/192p290/bin/rails:19:in `<main>'

错误提示“没有这样的文件或目录”,但文件存在。

[~] # cd /share/Ruby/192p290/lib/ruby/1.9.1/armv5tel-linux-eabi/digest && ls 
bubblebabble.so* rmd160.so*       sha2.so*
md5.so*          sha1.so*

版本:
ruby 1.9.2p290(2011-07-09 修订版 32553)[armv5tel-linux-eabi]
Rails 3.0.9
gem 1.3.7

Ruby 从自定义目录中的源代码安装并添加到 $PATH。

编辑:忘了提到我正在尝试将它安装在 QNAP TS-412 上。它在arm linux上运行。

编辑:
管理安装 RVM。安装了 ruby​​ 1.9.2 p320 仍然出现错误。

/opt/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': libcrypto.so.0.9.8: cannot open shared object file: No such file or directory - /opt/rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/armv5tel-linux-eabi/digest/md5.so (LoadError)
    from /opt/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.3/lib/rails/generators/app_base.rb:1:in `<top (required)>'
    from /opt/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.3/lib/rails/generators/rails/app/app_generator.rb:1:in `<top (required)>'
    from /opt/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.3/lib/rails/commands/application.rb:24:in `<top (required)>'
    from /opt/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.3/lib/rails/cli.rb:15:in `<top (required)>'
    from /opt/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.3/bin/rails:7:in `<top (required)>'
    from /opt/rvm/gems/ruby-1.9.2-p320/bin/rails:23:in `load'
    from /opt/rvm/gems/ruby-1.9.2-p320/bin/rails:23:in `<main>'

编辑:
卸载 RVM 并从源代码再次安装 ruby​​。仍然出现错误。

文件md5.so确实存在

[/share/Web] # cd /opt/local/lib/ruby/1.9.1/armv5tel-linux-eabi/digest/
[/opt/local/lib/ruby/1.9.1/armv5tel-linux-eabi/digest] # ls -l
-rwxr-xr-x    1 admin    administ    12338 May 10 19:56 bubblebabble.so*
-rwxr-xr-x    1 admin    administ    17847 May 10 19:56 md5.so*
-rwxr-xr-x    1 admin    administ    27764 May 10 19:56 rmd160.so*
-rwxr-xr-x    1 admin    administ    23159 May 10 19:56 sha1.so*
-rwxr-xr-x    1 admin    administ    39475 May 10 19:56 sha2.so*

编辑:
Ruby 不知何故未正确链接到加密库。

ruby -e 'require "digest/md5"'

这会引发相同的错误。

知道如何建立链接吗?

编辑:

试图使用

export LD_LIBRARY_PATH=/share/MD0_DATA/.qpkg/Optware/local/lib/ruby/1.9.1/armv5tel-linux-eabi/digest:$LD_LIBRARY_PATH
export RUBYLIB=/share/MD0_DATA/.qpkg/Optware/local/lib/ruby/1.9.1/armv5tel-linux-eabi/digest:$RUBYLIB

但我不知道我是否做得对。

4

2 回答 2

1

我建议使用 RVM 安装 Ruby。您拥有的自定义安装的 Ruby 可能没有正确链接到加密库。

这是 rvm 网站的链接:https ://rvm.io/

安装说明在这里:https ://rvm.io/rvm/install/

此外,我发现使用 brew 安装支持库通常可以提供更好的结果。

下面是由 Thoughtbot(领先的 Rails 咨询小组)维护的一组脚本的指针,用于设置运行 Rails 所需的一切新 Mac。

https://github.com/thoughtbot/laptop/blob/master/mac

按照那里的步骤(至少是那些适用的),你应该有好运。

于 2012-05-06T12:33:53.533 回答
1

终于解决了。

ln -s /share/MD0_DATA/.qpkg/Optware/lib/libcrypto.so.0.9.8 /lib/libcrypto.so.0.9.8

成功了。

于 2012-05-17T19:31:19.207 回答