場景:需要使用到 fluent,自然而然的使用到了 ruby 已經 gem,fluent 底層使用的 ruby + c 語言實作。
說之前小聲逼逼:
小日本的東西真難用
第一個錯誤: ERROR: Loading command: install (LoadError) cannot load such file -- zlib
需要安裝 ruby 本身對 zlib 的支援,瞎猜的,本身不會 ruby,下面是步驟
- yum -y install zlib-devel
- cd ruby-2.6.4/ext/zlib
- ruby ./extconf.rb
- make
- make install
若執行 make 是抛出錯誤:
make: *** No rule to make target
/include/ruby.h’, needed by
zlib.o'. Stop.
則執行以下指令
- vim Makefile
- 将
這一行加 # 注釋之後添加zlib.o: $(top_srcdir)/include/ruby.h
即可成功。zlib.o: ../../include/ruby.h
第二個錯誤和第一個則是大同小異,是抛出的錯誤
openssl
巨惡心!
openssl library could not be found. you might want to use --with-openssl-dir=<dir> option to specify
- cd ruby-2.6.4/ext/openssl
- ruby ./extconf.rb
- make
- make install
我這裡在執行第二步時一直抛出上面的問題,最後我隻能認為是我的 openssl 的版本低引起的問題,無奈之下隻能更換了 openssl 的版本為
OpenSSL 1.1.1d 10 Sep 2019
,如果有朋友發生同樣的問題,可以嘗試更換一下 openssl 的版本。
然後執行 make 接着抛出問題:
ruby make: *** No rule to make target
/include/ruby.h’, needed by
ossl.o'
,一個道理
- vim Makefile
- 這次是在 Makefile 中添加一行
,如下圖 這次是終于成功了~~~top_srcdir = ../..