编译安装logstash-output-jdbc插件--(1、g

2021-03-26  本文已影响0人  garfieldkai

在用mac编译插件时,需要用jruby,而mac默认的ruby环境不是,需要先安装jruby。mac安装使用ruby最安全方便的方式是使用rvm。

  1. 离线安装rvm

curl -sSL https://github.com/rvm/rvm/tarball/stable -o rvm-stable.tar.gz

mkdir rvm && cd rvm

tar --strip-components=1 -zxf ../rvm-stable.tar.gz

./install --auto-dotfiles

source ~/.rvm/scripts/rvm

  1. 安装jruby

rvm install jruby

  1. 应用jruby

rvm use jruby

因jruby需要另外单独安装bundle,和原ruby的bundle不通用,需要重新安装bundle

  1. 安装bundle

gem install bundler

  1. checkout插件源码
git clone https://github.com/theangryangel/logstash-output-jdbc
cd logstash-output-jdbc
  1. 安装依赖

bundle install

  1. 剩下的按照官方发布流程操作
bundle exec rake install_jars
bundle exec rake pre_release_checks
gem build logstash-output-jdbc.gemspec

最后得到的logstash-output-jdbc-5.4.0.gem 便是我们要的

上一篇 下一篇

猜你喜欢

热点阅读