“没有要加载的文件——net/https”-Heroku、Ruby、Ubuntu 10.04

问题描述 投票:0回答:2

我在其他博客和 stackoverflow 线程中看到过这个问题,但似乎没有人有答案。我正在尝试运行 heroku 并收到此错误:

/usr/local/heroku/vendor/gems/rest-client-1.6.1/lib/restclient.rb:9:in `rescue in <top (required)>': no such file to load -- net/https. Try running apt-get install libopenssl-ruby (LoadError)
from /usr/local/heroku/vendor/gems/rest-client-1.6.1/lib/restclient.rb:5:in `<top (required)>'
from /usr/local/heroku/vendor/gems/rest-client-1.6.1/lib/rest_client.rb:2:in `require'
from /usr/local/heroku/vendor/gems/rest-client-1.6.1/lib/rest_client.rb:2:in `<top (required)>'
from /usr/local/heroku/lib/heroku/client.rb:2:in `require'
from /usr/local/heroku/lib/heroku/client.rb:2:in `<top (required)>'
from /usr/local/heroku/lib/heroku.rb:3:in `require'
from /usr/local/heroku/lib/heroku.rb:3:in `<top (required)>'
from /usr/local/heroku/lib/heroku/cli.rb:1:in `require'
from /usr/local/heroku/lib/heroku/cli.rb:1:in `<top (required)>'
from /usr/bin/heroku:29:in `require'
from /usr/bin/heroku:29:in `<main>'

问题是 libopenssl-ruby 已经是最新版本了。

还有其他人遇到过这个问题吗?

ruby ubuntu heroku ubuntu-10.04
2个回答
13
投票

我刚刚在 ubuntu 10.04 上遇到了类似的问题,这样解决了:

编辑:

更快修复: 检查 /usr/local/heroku/bin/heroku 使用的 ruby 版本 我有:

#!/usr/bin/env ruby1.9.1

然后安装正确的库:

$ sudo apt-get install libopenssl-ruby1.9.1

旧:

安装rvm:http://beginrescueend.com/rvm/install/

在 ~/.bashrc 添加:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" 

运行:

$ source ~/.bachrc

然后:

$ rvm remove 1.9.2
$ rvm pkg install openssl
$ rvm install 1.9.2 -C --with-openssl-dir=$HOME/.rvm/usr

运行最后一个命令后,我得到了此输出,请注意 ruby-1.9.2-p290:

Installing Ruby from source to: /my/home/dir/.rvm/rubies/ruby-1.9.2-p290, this may take a while depending on your cpu(s)

然后编辑 /usr/local/heroku/bin/heroku 第一行更改:

#!/usr/bin/env ruby1.9.1

致:

#!/usr/bin/env ruby-1.9.2-p290 

您可能需要安装一些缺失的库才能使所有这些工作正常,这将有助于找到什么

$ rvm notes

我希望这有帮助。


0
投票

我猜这可能是一些权限问题,你应该更好地解释一下你是如何安装你的 ruby 的,其次检查 libopenssl-ruby 是否是当前用户的路径,如果不是,则将其添加到其路径中。

© www.soinside.com 2019 - 2024. All rights reserved.