Rails 3 - 没有要加载的文件 - openssl

发布于 2024-09-14 03:51:50 字数 557 浏览 2 评论 0原文

运行 Rails 服务器时,出现以下错误: 没有要加载的文件 - openssl

我尝试了在网上找到的解决方案。我转到 ~/.rvm/src/ruby-1.9.2-head/ext/openssl。我输入:ruby extconf.rb,但得到以下信息:

=== OpenSSL for Ruby configurator ===
=== Checking for system dependent stuff... ===
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for assert.h... yes
=== Checking for required stuff... ===
checking for openssl/ssl.h... no
=== Checking for required stuff failed. ===
Makefile wasn't created. Fix the errors above.

我无法使用 make 或 make install。

when running a Rails server, I get the following error:
no such file to load -- openssl

I try a solution I find online. I go to ~/.rvm/src/ruby-1.9.2-head/ext/openssl. I type : ruby extconf.rb, but I get the following:

=== OpenSSL for Ruby configurator ===
=== Checking for system dependent stuff... ===
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for assert.h... yes
=== Checking for required stuff... ===
checking for openssl/ssl.h... no
=== Checking for required stuff failed. ===
Makefile wasn't created. Fix the errors above.

I cannot use make nor make install.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

倾城泪 2024-09-21 03:51:50

rvm pkg install openssl(旧格式 - rvm package install openssl
rvm pkg install iconv(旧格式 - rvm package install iconv
rvm 删除 1.9.2
rvm install 1.9.2 -C --with-openssl-dir=$HOME/.rvm/usr,--with-iconv-dir=$HOME/.rvm/usr

归功于 http://www.isnull.com.ar/

rvm pkg install openssl (older format - rvm package install openssl)
rvm pkg install iconv (older format - rvm package install iconv)
rvm remove 1.9.2
rvm install 1.9.2 -C --with-openssl-dir=$HOME/.rvm/usr,--with-iconv-dir=$HOME/.rvm/usr

Credit to http://www.isnull.com.ar/

昔日梦未散 2024-09-21 03:51:50

检查此说明 http://rvm.io/packages/openssl/ - 请记住快速修复只是一个块而不是整个页面。

check this instruction http://rvm.io/packages/openssl/ - keep in mind that the Quick fix is just one block not the whole page.

三月梨花 2024-09-21 03:51:50

您必须为 openssl/net/http 安装库,运行以下代码,然后安装 openssl 和 iconv.. 以下代码将在 UBUNTU 上运行..

sudo apt-get install libopenssl-ruby1.9.1 这是对于红宝石 1.9.1。

对于 ruby​​ 1.8.x,sudo apt-get install libopenssl-ruby

You have to install library for openssl/net/http run the following code and then install openssl and iconv.. Following code will work on UBUNTU..

sudo apt-get install libopenssl-ruby1.9.1 this is for ruby 1.9.1.

sudo apt-get install libopenssl-ruby for ruby 1.8.x

疯狂的代价 2024-09-21 03:51:50

首先检查您的 rvm 是否有 openssl 软件包。转到 /usr/local/src/rvm/ruby-1.9.2-p290/

然后转到 ext/openssl。

输入ruby extconf.rb
如果我们发现这样的错误

enter code here
=== OpenSSL for Ruby configurator ===
=== Checking for system dependent stuff... ===
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for assert.h... yes
=== Checking for required stuff... ===
checking for openssl/ssl.h... no
=== Checking for required stuff failed. ===
Makefile wasn't created. Fix the errors above

然后安装 apt-get install libssl-dev。一旦安装 ruby​​ extconf.rb。现在 openssl 将被安装

first check your rvm having the openssl package. Go to /usr/local/src/rvm/ruby-1.9.2-p290/

then go to ext/openssl.

type ruby extconf.rb
If we found errors like this

enter code here
=== OpenSSL for Ruby configurator ===
=== Checking for system dependent stuff... ===
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for assert.h... yes
=== Checking for required stuff... ===
checking for openssl/ssl.h... no
=== Checking for required stuff failed. ===
Makefile wasn't created. Fix the errors above

Then install apt-get install libssl-dev.Once installed rub ruby extconf.rb.Now the openssl will get installed

像极了他 2024-09-21 03:51:50

对于 ubuntu,我做了以下操作:

apt-get install libssl-dev
cd ruby-1.9(source directory used to install ruby)/ext/openssl
ruby extconf.rb
make
make install

For ubuntu, I did the following:

apt-get install libssl-dev
cd ruby-1.9(source directory used to install ruby)/ext/openssl
ruby extconf.rb
make
make install
嗳卜坏 2024-09-21 03:51:50

这解决了我的问题:

rvm pkg install openssl
rvm reinstall 1.9.2 --with-openssl-dir=$rvm_path/usr

并且不要忘记将 ruby​​ 版本更改为您正在使用的版本。如果您有旧的 rvm,您也应该首先更新它。

This solved the problem for me:

rvm pkg install openssl
rvm reinstall 1.9.2 --with-openssl-dir=$rvm_path/usr

And don't forget to change the ruby version to your version you are using. If you have an old rvm you may should update this at first too.

你又不是我 2024-09-21 03:51:50

我做了

rvm pkg install openssl
rvm reinstall 1.9.3

并且完成了!

I made

rvm pkg install openssl
rvm reinstall 1.9.3

and done!

千と千尋 2024-09-21 03:51:50

您可能想尝试运行 ruby​​-1.9.2-rc2 而不是 head ?
不确定它是否会解决这个问题,但我确实遇到了很多问题,尝试在 head 下运行,

非常确定命令看起来像 - rvm install 1.9.2-rc2

你将需要再次重新安装 Rails

You might want to try running ruby-1.9.2-rc2 instead of head?
not sure if it will solve this issue or not, but I did have a lot of problems trying to run under head

pretty sure the the command would look like - rvm install 1.9.2-rc2

you will need to re-install rails again

初熏 2024-09-21 03:51:50

此错误意味着您的 Ruby 不是使用 openssl 编译的。
假设您使用 RVM,请按照以下步骤解决此问题。

1.安装 openssl 软件包

rvm pkg install openssl

2.删除您正在使用的 Ruby 安装

rvm remove 1.9.3

3.最后用 openssl 重新编译 Ruby

rvm install 1.9.3 --with-openssl-dir=$HOME/.rvm/usr

4.现在一切都应该可以正常工作了。不要忘记:

rvm 使用 1.9.3 --default

This error means that your Ruby isn’t compiled with openssl.
Assuming that you use RVM, these are the steps to follow to fix this issue.

1.Install the openssl package

rvm pkg install openssl

2.Remove the Ruby installation you’re using

rvm remove 1.9.3

3.And finally recompile Ruby with openssl

rvm install 1.9.3 --with-openssl-dir=$HOME/.rvm/usr

4.Everything should be working now. Don’t forget to:

rvm use 1.9.3 --default

面犯桃花 2024-09-21 03:51:50

尝试以下步骤。

  1. rvm get stablebrew
  2. install libyaml
  3. rvm pkg install openssl
  4. rvm install ruby​​-2.0.0 --with-openssl-dir=$HOME/.rvm/usr
  5. rvm 使用 ruby​​-2.0.0

如果您已经有 ruby​​ 版本,请使用

rvm 重新安装 ruby​​- 2.0.0 --with-openssl-dir=$HOME/.rvm/usr

Try the below steps.

  1. rvm get stable
  2. brew install libyaml
  3. rvm pkg install openssl
  4. rvm install ruby-2.0.0 --with-openssl-dir=$HOME/.rvm/usr
  5. rvm use ruby-2.0.0

if you already have ruby version use

rvm reinstall ruby-2.0.0 --with-openssl-dir=$HOME/.rvm/usr

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文