在Ubuntu上运行Sinatra,未初始化的常量错误 [英] Getting Sinatra running on Ubuntu, Uninitialized constant error
本文介绍了在Ubuntu上运行Sinatra,未初始化的常量错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
sudo gem install sinatra
我得到:
错误:执行gem时...(NameError)
未初始化的常量Gem :: RemoteFetcher :: OpenSSL
rvm req installs:
pre $ sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsq
lite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
正在读取软件包列表...完成
构建依赖树
阅读状态信息...完成
注意,选择'libxslt1-dev'而不是'libxslt-dev'
注意,选择'libncurses5-dev'而不是'ncurses-dev'
autoconf已经是最新版本。
automake已经是最新版本。
bison已经是最新版本了。
curl已经是最新版本了。
git-core已经是最新版本。
libncurses5-dev已经是最新版本。
libreadline6已经是最新版本。
libtool已经是最新版本。
libyaml-dev已经是最新版本。
subversion已经是最新版本。
zlib1g已经是最新版本。
zlib1g-dev已经是最新版本。
build-essential已经是最新版本。
libc6-dev已经是最新版本。
libsqlite3-dev已经是最新版本。
libssl-dev已经是最新版本。
libxml2-dev已经是最新版本。
libxslt1-dev已经是最新版本。
openssl已经是最新版本。
sqlite3已经是最新版本。
以下软件包将被删除:
libreadline-gplv2-dev
将安装以下新软件包:
libreadline6-dev pkg-config
0已升级,2新安装,1删除和7未升级。
需要获得40.9 kB / 305 kB的档案。
在此操作之后,将使用201 kB的额外磁盘空间。
是否要继续[Y / n]? y
Ruby版本:
ruby -v
ruby 1.9.3p327(2012-11-10 revision 37606)[x86_64-linux]
解决方案
如果rubygems.org无法通过DNS解析,则会发生此错误(未初始化常量Gem :: RemoteFetcher :: OpenSSL)
。
它发生在我身上。一旦DNS恢复了它的意义,gem install开始
再次工作。
Trying to get Sinatra setup on Ubuntu 12.04. I have RVM installed, and I think I have installed all dependencies (listed below). I found another SO post (here) that indicated I don't have libssl-dev installed, but it looks like I do. When I run:
sudo gem install sinatra
I get:
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::RemoteFetcher::OpenSSL
rvm req installs:
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsq
lite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libxslt1-dev' instead of 'libxslt-dev'
Note, selecting 'libncurses5-dev' instead of 'ncurses-dev'
autoconf is already the newest version.
automake is already the newest version.
bison is already the newest version.
curl is already the newest version.
git-core is already the newest version.
libncurses5-dev is already the newest version.
libreadline6 is already the newest version.
libtool is already the newest version.
libyaml-dev is already the newest version.
subversion is already the newest version.
zlib1g is already the newest version.
zlib1g-dev is already the newest version.
build-essential is already the newest version.
libc6-dev is already the newest version.
libsqlite3-dev is already the newest version.
libssl-dev is already the newest version.
libxml2-dev is already the newest version.
libxslt1-dev is already the newest version.
openssl is already the newest version.
sqlite3 is already the newest version.
The following packages will be REMOVED:
libreadline-gplv2-dev
The following NEW packages will be installed:
libreadline6-dev pkg-config
0 upgraded, 2 newly installed, 1 to remove and 7 not upgraded.
Need to get 40.9 kB/305 kB of archives.
After this operation, 201 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Ruby Version:
ruby -v
ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]
解决方案
This error (uninitialized constant Gem::RemoteFetcher::OpenSSL) can occur if rubygems.org cannot be resolved via DNS. It just happened to me. Once DNS came back to its senses, gem install started working again.
这篇关于在Ubuntu上运行Sinatra,未初始化的常量错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文