Rails 3 - 没有要加载的文件 - openssl
运行 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
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/
检查此说明 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.
您必须为 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首先检查您的 rvm 是否有 openssl 软件包。转到 /usr/local/src/rvm/ruby-1.9.2-p290/
然后转到 ext/openssl。
输入ruby extconf.rb
如果我们发现这样的错误
然后安装 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
Then install apt-get install libssl-dev.Once installed rub ruby extconf.rb.Now the openssl will get installed
对于 ubuntu,我做了以下操作:
For ubuntu, I did the following:
这解决了我的问题:
并且不要忘记将 ruby 版本更改为您正在使用的版本。如果您有旧的 rvm,您也应该首先更新它。
This solved the problem for me:
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.
我做了
并且完成了!
I made
and done!
您可能想尝试运行 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
此错误意味着您的 Ruby 不是使用 openssl 编译的。
假设您使用 RVM,请按照以下步骤解决此问题。
1.安装 openssl 软件包
2.删除您正在使用的 Ruby 安装
3.最后用 openssl 重新编译 Ruby
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
2.Remove the Ruby installation you’re using
3.And finally recompile Ruby with openssl
4.Everything should be working now. Don’t forget to:
rvm use 1.9.3 --default
尝试以下步骤。
如果您已经有 ruby 版本,请使用
rvm 重新安装 ruby- 2.0.0 --with-openssl-dir=$HOME/.rvm/usr
Try the below steps.
if you already have ruby version use
rvm reinstall ruby-2.0.0 --with-openssl-dir=$HOME/.rvm/usr