@
dorentus 成功安装,我估计是我环境的问题,虽然安装了2.1.1版的ruby,但是实际上是切换成系统自带的1.8版的ruby,因为有时候启动终端时会提示如下错误:
/Library/Ruby/Gems/1.8/gems/cowsay-0.0.5/lib/cowsay/character/base.rb:20:in `template': #template should be subclassed (RuntimeError)
from /Library/Ruby/Gems/1.8/gems/cowsay-0.0.5/lib/cowsay/character/base.rb:26:in `render_character'
from /Library/Ruby/Gems/1.8/gems/cowsay-0.0.5/lib/cowsay/character/base.rb:16:in `say'
from /Library/Ruby/Gems/1.8/gems/cowsay-0.0.5/lib/cowsay.rb:17:in `say'
from /Library/Ruby/Gems/1.8/gems/cowsay-0.0.5/bin/cowsay:6
from /usr/bin/cowsay:19:in `load'
from /usr/bin/cowsay:19
对了,我发现#
lolcat-banner.sh `fortune -a -s | $cmd_sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | $cmd_lolcat -f`
修改为才不出错
`fortune -a -s | $cmd_sed -E "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | $cmd_lolcat -f`
Linux下`sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"`
Mac下`sed -E "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"`