ruby - 在设置 RVM 环境以使用 Gist 和 OpenSSL 时遇到问题

标签 ruby openssl rvm gist

我尝试按照 RVM 中列出的说明进行操作让 OpenSSL 正常工作,以便 Gist 与 pry 一起工作。但是,尽管尝试了所有建议,但我还是不断收到这些错误。我不太了解结构,无法尝试不同的选项。

stanley@ubuntu:~/Downloads$ pry
[1] pry(main)> gist s.each_line
LoadError: cannot load such file -- openssl
from /home/stanley/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
[2] pry(main)> 
stanley@ubuntu:~/Downloads$ gem install openssl
ERROR:  Could not find a valid gem 'openssl' (>= 0) in any repository
ERROR:  Possible alternatives: opendsl, OpenS3, open_dsl, opensrs, openurl
stanley@ubuntu:~/Downloads$ rm -rf $rvm_path/usr
stanley@ubuntu:~/Downloads$ rvm requirements

Requirements for Linux ( DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.10
DISTRIB_CODENAME=oneiric
DISTRIB_DESCRIPTION="Ubuntu 11.10" )

NOTE: 'ruby' represents Matz's Ruby Interpreter (MRI) (1.8.X, 1.9.X)
             This is the *original* / standard Ruby Language Interpreter
      'ree'  represents Ruby Enterprise Edition
      'rbx'  represents Rubinius

bash >= 4.1 required
curl is required
git is required (>= 1.7 for ruby-head)
patch is required (for 1.8 rubies and some ruby-head's).

To install rbx and/or Ruby 1.9 head (MRI) (eg. 1.9.2-head),
then you must install and use rvm 1.8.7 first.

Additional Dependencies:
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
  ruby: /usr/bin/apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion

# For JRuby, install the following:
  jruby: /usr/bin/apt-get install curl g++ openjdk-6-jre-headless
  jruby-head: /usr/bin/apt-get install ant openjdk-6-jdk

# For IronRuby, install the following:
  ironruby: /usr/bin/apt-get install curl mono-2.0-devel

stanley@ubuntu:~/Downloads$ rvm reinstall 1.9.2 --with-openssl-dir=/usr/local
it seems that /home/stanley/.rvm/src/ruby-1.9.2-p320 is already non existent.
it seems that /home/stanley/.rvm/rubies/ruby-1.9.2-p320 is already non existent.
Removing ruby-1.9.2-p320 aliases...
Removing ruby-1.9.2-p320 wrappers...
Removing ruby-1.9.2-p320 environments...
Removing ruby-1.9.2-p320 binaries...
Fetching yaml-0.1.4.tar.gz to /home/stanley/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /home/stanley/.rvm/src
Prepare yaml in /home/stanley/.rvm/src/yaml-0.1.4.
Configuring yaml in /home/stanley/.rvm/src/yaml-0.1.4.
Compiling yaml in /home/stanley/.rvm/src/yaml-0.1.4.
Installing yaml to /home/stanley/.rvm/usr
Installing Ruby from source to: /home/stanley/.rvm/rubies/ruby-1.9.2-p320, this may take a while depending on your cpu(s)...

ruby-1.9.2-p320 - #fetching 
ruby-1.9.2-p320 - #downloading ruby-1.9.2-p320, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 8770k  100 8770k    0     0   171k      0  0:00:50  0:00:50 --:--:--  212k
ruby-1.9.2-p320 - #extracting ruby-1.9.2-p320 to /home/stanley/.rvm/src/ruby-1.9.2-p320
ruby-1.9.2-p320 - #extracted to /home/stanley/.rvm/src/ruby-1.9.2-p320
ruby-1.9.2-p320 - #configuring 
ruby-1.9.2-p320 - #compiling 
ruby-1.9.2-p320 - #installing 
Removing old Rubygems files...
Installing rubygems-1.8.24 for ruby-1.9.2-p320 ...
Installation of rubygems completed successfully.
ruby-1.9.2-p320 - adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.9.2-p320 - #importing default gemsets (/home/stanley/.rvm/gemsets/)
Install of ruby-1.9.2-p320 - #complete 
stanley@ubuntu:~/Downloads$ pry
[1] pry(main)> gist s.each_line
LoadError: cannot load such file -- openssl
from /home/stanley/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
[2] pry(main)> 
stanley@ubuntu:~/Downloads$ rvm pkg install openssl
Fetching openssl-0.9.8t.tar.gz to /home/stanley/.rvm/archives
Extracting openssl-0.9.8t.tar.gz to /home/stanley/.rvm/src
Configuring openssl in /home/stanley/.rvm/src/openssl-0.9.8t.
Compiling openssl in /home/stanley/.rvm/src/openssl-0.9.8t.
Installing openssl to /home/stanley/.rvm/usr
stanley@ubuntu:~/Downloads$ pry
[1] pry(main)> gist s.each_line
LoadError: cannot load such file -- openssl
from /home/stanley/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
[2] pry(main)> 
stanley@ubuntu:~/Downloads$ rvm reinstall 1.9.2 --with-openssl-dir=$rvm_path/usr
Removing /home/stanley/.rvm/src/ruby-1.9.2-p320...
Removing /home/stanley/.rvm/rubies/ruby-1.9.2-p320...
Removing ruby-1.9.2-p320 aliases...
Removing ruby-1.9.2-p320 wrappers...
Removing ruby-1.9.2-p320 environments...
Removing ruby-1.9.2-p320 binaries...
Installing Ruby from source to: /home/stanley/.rvm/rubies/ruby-1.9.2-p320, this may take a while depending on your cpu(s)...

ruby-1.9.2-p320 - #fetching 
ruby-1.9.2-p320 - #extracting ruby-1.9.2-p320 to /home/stanley/.rvm/src/ruby-1.9.2-p320
ruby-1.9.2-p320 - #extracted to /home/stanley/.rvm/src/ruby-1.9.2-p320
ruby-1.9.2-p320 - #configuring 
ruby-1.9.2-p320 - #compiling 
ruby-1.9.2-p320 - #installing 
Removing old Rubygems files...
Installing rubygems-1.8.24 for ruby-1.9.2-p320 ...
Installation of rubygems completed successfully.
ruby-1.9.2-p320 - adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.9.2-p320 - #importing default gemsets (/home/stanley/.rvm/gemsets/)
Install of ruby-1.9.2-p320 - #complete 
stanley@ubuntu:~/Downloads$ pry
[1] pry(main)> gist s.each_line
LoadError: cannot load such file -- openssl
from /home/stanley/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
[2] pry(main)> 
stanley@ubuntu:~/Downloads$  rvm --skip-autoreconf pkg install openssl
Fetching openssl-0.9.8t.tar.gz to /home/stanley/.rvm/archives
Extracting openssl-0.9.8t.tar.gz to /home/stanley/.rvm/src
Configuring openssl in /home/stanley/.rvm/src/openssl-0.9.8t.
Compiling openssl in /home/stanley/.rvm/src/openssl-0.9.8t.
Installing openssl to /home/stanley/.rvm/usr
stanley@ubuntu:~/Downloads$ pry
[1] pry(main)> gist s.each_line
LoadError: cannot load such file -- openssl
from /home/stanley/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
[2] pry(main)> 

您对我解决这个问题有什么建议?预先感谢您的帮助。

最佳答案

您安装的是您的发行版的 openssl。它不是 gem 。它是一个操作系统包

关于ruby - 在设置 RVM 环境以使用 Gist 和 OpenSSL 时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10561853/

相关文章:

ruby - 无法理解 Ruby 中的 "unless"关键字

ruby-on-rails - 我如何处理两个具有不同 Ruby/Rails 版本的应用程序?

android - 将 Qt 网络功能与不同 OpenSSL 版本一起使用

OS X 上的 Python 和 OpenSSL 版本引用问题

ruby - 使用 Watir 删除元素

Ruby/PG - 无法连接到 PostgreSQL

openssl - 这个 pkcs12 文件 (pfx) 有什么问题

ruby - 为什么 RVM 会为不同的 gemset 安装重复的 gem?

ruby-on-rails - 叉叉 rails 、 rails 3.2 和 'no such file to load'

ruby-on-rails - 安装 Rails 时出现 "ERROR: Failed to build gem native extension."