执行ruby script/console,可是报错
原来是没有安装readline,就设置了一下代理
在执行yum install ncurses-devel的时候又报错,(ncurses-devel里包含readline),:shock:
在网上查了好久,也没有找到原因。突然想起是不是代理设定的不够规范呀。重新设定了代理。
OK,ncurses-devel顺利安装成功。
然后,跑到ruby安装目录的ext/readline下,执行下边的命令。
:o 怎么又
居然又少readline.h。啊啊。装readline-devel吧。
再执行
终于可以执行ruby script/console了。
ruby script/console
Loading development environment.
/usr/local/ruby/lib/ruby/1.8/irb/completion.rb:10:in `require': no such file to load -- readline (LoadError)
from /usr/local/ruby/lib/ruby/1.8/irb/completion.rb:10
from /usr/local/ruby/lib/ruby/1.8/irb/init.rb:252:in `require'
from /usr/local/ruby/lib/ruby/1.8/irb/init.rb:252:in `load_modules'
from /usr/local/ruby/lib/ruby/1.8/irb/init.rb:250:in `each'
from /usr/local/ruby/lib/ruby/1.8/irb/init.rb:250:in `load_modules'
from /usr/local/ruby/lib/ruby/1.8/irb/init.rb:21:in `setup'
from /usr/local/ruby/lib/ruby/1.8/irb.rb:54:in `start'
from /usr/local/ruby/bin/irb:13
原来是没有安装readline,就设置了一下代理
export http_proxy=17x.xx.xx.xxx:8080
在执行yum install ncurses-devel的时候又报错,(ncurses-devel里包含readline),:shock:
yum install ncurses-devel
Loading "fastestmirror" plugin
Determining fastest mirrors
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?
yummain.main(sys.argv[1:])
File "/usr/share/yum-cli/yummain.py", line 105, in main
result, resultmsgs = base.doCommands()
File "/usr/share/yum-cli/cli.py", line 289, in doCommands
self._getTs()
File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 85, in _getTs
self._getTsInfo()
File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 91, in _getTsInfo
self._tsInfo.setDatabases(self.rpmdb, self.pkgSack)
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 537, in <lambda>
pkgSack = property(fget=lambda self: self._getSacks(),
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 392, in _getSacks
self.repos.populateSack(which=repos)
File "/usr/lib/python2.4/site-packages/yum/repos.py", line 214, in populateSack
self.doSetup()
File "/usr/lib/python2.4/site-packages/yum/repos.py", line 66, in doSetup
self.ayum.plugins.run('postreposetup')
File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 169, in run
func(conduitcls(self, self.base, conf, **kwargs))
File "/usr/lib/yum-plugins/fastestmirror.py", line 90, in postreposetup_hook
repomirrors[str(repo)] = FastestMirror(repo.urls).get_mirrorlist()
File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 528, in <lambda>
urls = property(fget=lambda self: self._geturls(),
File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 525, in _geturls
self._baseurlSetup()
File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 490, in _baseurlSetup
mirrorurls.extend(self._getMirrorList())
File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 940, in _getMirrorList
fo = urlgrabber.grabber.urlopen(url, proxies=self.proxy_dict)
File "/usr/lib/python2.4/site-packages/urlgrabber/grabber.py", line 605, in urlopen
return default_grabber.urlopen(url, **kwargs)
File "/usr/lib/python2.4/site-packages/urlgrabber/grabber.py", line 884, in urlopen
return self._retry(opts, retryfunc, url)
File "/usr/lib/python2.4/site-packages/urlgrabber/grabber.py", line 845, in _retry
r = apply(func, (opts,) + args, {})
File "/usr/lib/python2.4/site-packages/urlgrabber/grabber.py", line 883, in retryfunc
return URLGrabberFileObject(url, filename=None, opts=opts)
File "/usr/lib/python2.4/site-packages/urlgrabber/grabber.py", line 1001, in __init__
self._do_open()
File "/usr/lib/python2.4/site-packages/urlgrabber/grabber.py", line 1072, in _do_open
fo, hdr = self._make_request(req, opener)
File "/usr/lib/python2.4/site-packages/urlgrabber/grabber.py", line 1172, in _make_request
fo = opener.open(req)
File "/usr/lib/python2.4/urllib2.py", line 358, in open
response = self._open(req, data)
File "/usr/lib/python2.4/urllib2.py", line 376, in _open
'_open', req)
File "/usr/lib/python2.4/urllib2.py", line 337, in _call_chain
result = func(*args)
File "/usr/lib/python2.4/urllib2.py", line 573, in <lambda>
lambda r, proxy=url, type=type, meth=self.proxy_open: \
File "/usr/lib/python2.4/urllib2.py", line 580, in proxy_open
if '@' in host:
TypeError: iterable argument required
在网上查了好久,也没有找到原因。突然想起是不是代理设定的不够规范呀。重新设定了代理。
export http_proxy=http://172.25.75.2:8080/
OK,ncurses-devel顺利安装成功。
然后,跑到ruby安装目录的ext/readline下,执行下边的命令。
ruby extconf.rb && make && make install
:o 怎么又
ruby extconf.rb
checking for tgetnum() in -lncurses... yes
checking for readline/readline.h... no
checking for editline/readline.h... no
居然又少readline.h。啊啊。装readline-devel吧。
yum install readline-devel
再执行
ruby extconf.rb && make && make install
终于可以执行ruby script/console了。