操作系统:Ubuntu Server 11.10
我在尝试“gem install rails”时遇到此错误。
/home/bindiry/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- socket (LoadError)
from /home/bindiry/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/bindiry/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/protocol.rb:21:in `<top (required)>'
这是我的安装过程:
sudo apt-get update
sudo apt-get install unzip curl aptitude
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
echo '[[ -s "/home/bindiry/.rvm/scripts/rvm" ]] && source "/home/bindiry/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*' >> ~/.bashrc
source .bashrc
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev \
curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev \
libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev \
autoconf libc6-dev ncurses-dev automake libtool bison g++ nodejs \
libapr1 libaprutil1 libneon27-gnutls libsvn1 subversion pkg-config
rvm get stable
rvm install 1.9.3
rvm 1.9.3 --default
ruby -v
# ruby 1.9.3p125 (2012-02-16 revision 34643) [i686-linux]
任何想法都会有所帮助。
感谢。
更新
我解决了这个问题。
确保卸载1.9.3。
rvm pkg install openssl
rvm install 1.9.3 --with-openssl-dir=$rvm_path/usr
进行。
答案 0 :(得分:0)
安装套接字
sudo apt-get install socket
答案 1 :(得分:0)
我解决了这个问题。
确保卸载1.9.3。
rvm pkg install openssl
rvm install 1.9.3 --with-openssl-dir=$rvm_path/usr