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

Ruby 在设置RVM环境以使用Gist和OpenSSL时遇到问题,ruby,openssl,rvm,gist,Ruby,Openssl,Rvm,Gist,我尝试按照中列出的说明使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

我尝试按照中列出的说明使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。它不是宝石。它是一个操作系统软件包

我最终按照中的答案进行了操作。然后重新安装ruby以使gist正常工作。

我很难找到发行版的openssl包。我是根据OpenSSL网站上的文件构建和安装的。看起来RVM正在为您建议一个修复方案。尝试运行
/usr/bin/apt get install build sential 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
来安装Ruby的所有依赖项。