- /home/michell/.rvm/rubies/ruby-2.2.0/bin/ruby -r ./siteconf20160425-25421-vzm9hx.rb extconf.rb
- creating Makefile
- make "DESTDIR=" clean
- make "DESTDIR="
- compiling generator.c
- In file included from generator.c:1:0:
- ../fbuffer/fbuffer.h: In function ‘fbuffer_to_s’:
- ../fbuffer/fbuffer.h:175:47: error: macro "rb_str_new" requires 2 arguments, but only 1 given
- VALUE result = rb_str_new(FBUFFER_PAIR(fb));
- ^
- ../fbuffer/fbuffer.h:175:20: warning: initialization makes integer from pointer without a cast [enabled by default]
- VALUE result = rb_str_new(FBUFFER_PAIR(fb));
- ^
- make: *** [generator.o] Error 1
- make failed, exit code 2
json1.8.1跟ruby2.2不兼容,要回到ruby2.1。
但是rubygem不支持2.1,无论哪个ports,在make时都会出现ruby2.2.5的编译。
于是又回到一个古老的问题:在FreeBSD下,如何强制使用一个软件的版本?
不是所有的软件都支持版本的选项,但是常用的几个大语言是可以的,在/usr/ports/Mk/目录下,一大堆mk文件,里面基本上都有版本的说明。
对于ruby,可以看bsd.ruby.mk
- vi /usr/ports/Mk/bsd.ruby.mk
- # RUBY_VER - (See below)
- # RUBY_DEFAULT_VER - Set to (e.g.) "1.9" if you want to refer to "ruby19"
- # just as "ruby".
- # RUBY_ARCH - (See below)
- # RUBY_RD_HTML - Define if you want HTML files generated from RD files.
- #
- #
RUBY_DEFAULT_VER=2.1
效果也是可见的:每次ports开始编译ruby相关的文件,都会抱怨一句:您已经强制使用ruby版本,我在乖乖地遵从您的指示!
---end---