Tag Archives: update

ruby gems 更改源

因为众所周知的原因,gem update,install等命令经常会遇到超时timeout,半天无响应,卡住等问题,建议换成淘宝的镜像源:

$ gem sources --remove https://rubygems.org/
$ gem sources -a https://ruby.taobao.org/
$ gem sources -l
*** CURRENT SOURCES ***

https://ruby.taobao.org
# 请确保只有 ruby.taobao.org
$ gem install rails

 

 

参考资料:http://ruby.taobao.org/

解决freebsd升级到最新ports遇到的问题

系统环境

uname -a
FreeBSD AN 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Wed Jul 31 16:20:23 CST 2013   amd64

更新系统的ports tree

先su获取root权限:

portsnap fetch
portsnap extract

出错

安装vim:

cd /usr/ports/editors/vim
make install clean

出错:

Unknown modifier 't'

Unknown modifier 't'

Unknown modifier 't'

Unknown modifier 't'

"Makefile", line 137: Malformed conditional (${PYTHON_REL} < 300)
"Makefile", line 142: if-less endif
Unknown modifier 't'

Unknown modifier 't'

Unknown modifier 't'

Unknown modifier 't'

Unknown modifier 't'

"/usr/ports/Mk/bsd.sites.mk", line 953: Malformed conditional (!empty(_PERL_CPAN_ID) && ${_PERL_CPAN_FLAG:tl} == "cpan")
Unknown modifier 't'

Unknown modifier 't'

Unknown modifier 't'

Unknown modifier 't'

"/usr/ports/Mk/bsd.port.mk", line 2877: Unclosed conditional/for loop
"/usr/ports/Mk/bsd.port.mk", line 2877: Unexpected end of file in for loop.

"/usr/ports/Mk/bsd.port.mk", line 6590: Unclosed conditional/for loop
"/usr/ports/Mk/bsd.port.mk", line 6590: Unexpected end of file in for loop.

1 open conditional:
         at line 1177 (evaluated to true)
make: fatal errors encountered -- cannot continue

谷歌查了一下,原因是7.0这个release不是一个正在维护的版本了,更新后的ports tree和当前的版本不兼容。

解决办法

  • 升级当前系统到最新版本
  • 重新恢复port tree到当前对应版本

stackoverflow的一篇帖子给了我灵感,到freebsd的找到了ports tree的官方备份网站找到了压缩包,恢复之: 用root用户下载install.sh和ports.tgz到/root文件夹,执行脚本解压

sh ./install.sh