no such file to load -- openssl (RuntimeError)

今天更新了Rails到2.0.2版本,启动application时出现了一下错误:

=> Booting WEBrick...
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:159:in `require_frameworks': no such file to load -- openssl (RuntimeError)
from /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:88:in `process'
from /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:49:in `send'
from /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:49:in `run'
from /home/simon/dev/depot/config/environment.rb:13
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
... 7 levels...
from /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from script/server:3


一开始还以为自己没有安装 openssl, 一查已经 安装过openssl,原来是少安装了libopenssl-ruby


simon@simon-laptop:~$ sudo apt-cache search libopenssl-ruby
ruby1.8 - Interpreter of object-oriented scripting language Ruby 1.8
libopenssl-ruby - OpenSSL interface for Ruby
libopenssl-ruby1.8 - OpenSSL interface for Ruby 1.8
libopenssl-ruby1.9 - OpenSSL interface for Ruby 1.9



我使用的是ruby1.8,所以就 sudo apt-get install libopenssl-ruby1.8
然后重启应用,问题解决。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
This error message typically occurs when the OpenSSL library is not installed or is not properly linked to the Ruby installation. To resolve this error, you can try the following solutions: 1. Install OpenSSL library: On Linux or macOS, use the system package manager to install OpenSSL. For example, on Ubuntu or Debian, run: ``` sudo apt-get install libssl-dev ``` On macOS, you can install OpenSSL using Homebrew: ``` brew install openssl ``` On Windows, download and install the OpenSSL library from the official website. 2. Reinstall Ruby with OpenSSL support: If you installed Ruby from source, make sure to enable OpenSSL support by passing the `--with-openssl-dir` flag to the `configure` script. For example: ``` ./configure --with-openssl-dir=/usr/local/opt/openssl ``` If you installed Ruby using a package manager like Homebrew, try reinstalling it with OpenSSL support: ``` brew reinstall ruby --with-openssl ``` 3. Set the OpenSSL library path: If you have installed OpenSSL in a non-standard location, you may need to set the `LD_LIBRARY_PATH` environment variable to the path where OpenSSL libraries are located. For example: ``` export LD_LIBRARY_PATH=/usr/local/opt/openssl/lib ``` 4. Use a Ruby version manager: Consider using a Ruby version manager like RVM or rbenv, which can manage multiple Ruby installations and their dependencies, including OpenSSL. This can help avoid conflicts between different Ruby versions and system libraries. After trying one or more of these solutions, try running your Ruby program again. If the error persists, you may need to seek further assistance or consult the documentation for your specific environment.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值