创建新的Rails应用程序时加载错误

时间:2012-05-05 19:06:24

标签: ruby-on-rails linux

创建新的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
宝石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

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

2 个答案:

答案 0 :(得分: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

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

答案 1 :(得分:1)

最终解决了。

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

做了这个伎俩。