需求
为了开发新的 logstash 插件
问题
原以为只是很简单的 bundle install 就能搞定的事情,实际却遇到了一堆问题。
1. clone git git@github.com:logstash-plugins/logstash-filter-example.git
2. cd logstash-filter-example
3. bundle install,结果报错:Could not find gem 'logstash-devutils'
lcy@lcy:~/logstash-filter-example$ bundle install Fetching gem metadata from https://rubygems.org/.......... Fetching version metadata from https://rubygems.org/... Fetching dependency metadata from https://rubygems.org/.. Could not find gem 'logstash-devutils' in any of the gem sources listed in your Gemfile or available on this machine.
解决
最开始以为只是有依赖无法解决,于是一个个慢慢安装依赖包,,,最后才发现,原来需要使用 jruby !!!
1. rvm install jruby
2. rvm gemset create example
3. rvm use jruby-1.7.19@example
4. bundle install
5. OK 了。