[英]Logstash plugin development
I'm trying to develop an input plugin for logstash. 我正在尝试为Logstash开发输入插件。
i've used this tutorial 我用过本教程
http://blog.eagerelk.com/how-to-write-a-logstash-plugin/ http://blog.eagerelk.com/how-to-write-a-logstash-plugin/
the problem that i've had when i tried to install "bundle" using "bundle install" 我尝试使用“捆绑安装”安装“捆绑”时遇到的问题
- this is the error message -这是错误消息
Your Ruby engine is ruby, but your Gemfile specified jruby 您的Ruby引擎是ruby,但是您的Gemfile指定了jruby
- Gemfile: -宝石文件:
source ' https://rubygems.org ' ruby '2.2.0', :engine => 'jruby', :engine_version => '2.3.1' gemspec 来源' https ://rubygems.org'ruby'2.2.0',:engine =>'jruby',:engine_version =>'2.3.1'gemspec
- ruby -v : -红宝石-v:
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin16] 红宝石2.2.0p0(2014-12-25修订版49005)[x86_64-darwin16]
- jruby -v : -jruby -v:
jruby 9.1.8.0 (2.3.1) 2017-03-06 90fc7ab Java HotSpot(TM) 64-Bit Server VM 25.92-b14 on 1.8.0_92-b14 +jit [darwin-x86_64] jruby 9.1.8.0(2.3.1)2017-03-06 90fc7ab Java HotSpot(TM)64位服务器VM 1.8.0_92-b14 + jit上的25.92-b14 [darwin-x86_64]
What am I doing wrong here? 我在这里做错了什么?
Since you are using rbenv
, here are some good troubleshooting steps: 由于您正在使用
rbenv
,因此这里有一些很好的故障排除步骤:
PATH
contains /path/to/your/home/directory/.rbenv/shims
or some similar variant. PATH
包含/path/to/your/home/directory/.rbenv/shims
或某些类似的变体。 eval "$(rbenv init -)"
in your shell's .bash|zsh|whateverrc
file. .bash|zsh|whateverrc
文件中使用eval "$(rbenv init -)"
。 .ruby-version
file. .ruby-version
文件。 Change to the directory of the project you're working on and invoke cat .ruby-version
. cat .ruby-version
。
rbenv install --list
, but the latest (from my local ruby-build
) is jruby-9.1.7.0
rbenv install --list
,但是最新的(来自我本地的ruby-build
)是jruby-9.1.7.0
rbenv install
. rbenv install
。 If you don't wish to make the file / want to skip this step just run rbenv install jruby-9.1.7.0
rbenv install jruby-9.1.7.0
rbenv rehash; bundle
rbenv rehash; bundle
should now work. rbenv rehash; bundle
现在应该可以工作了。 Looks like your bundler is trying to use the system's default Ruby version instead of use the JRuby. 看来您的捆绑软件正在尝试使用系统的默认Ruby版本而不是JRuby。
I recommend to you uninstall all previous installations of Ruby to make your system clean again. 我建议您卸载所有先前安装的Ruby,以再次使系统干净。
After that, make sure your PATH
is correct. 之后,请确保您的
PATH
是正确的。
If you're using bash, your ~/.bashrc
or ~/.bash_profile
should have the following commands: 如果您使用的是bash,则
~/.bashrc
或~/.bash_profile
应该具有以下命令:
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
If you're using zsh, these commands must resides in ~/.zshrc
. 如果您使用的是zsh,则这些命令必须位于
~/.zshrc
。
After that, enter your project directory and creates a new file .ruby-version
: 之后,进入您的项目目录并创建一个新文件
.ruby-version
:
echo 'jruby-9.1.7.0' > .ruby-version
Note: you can see other versions available using the command rbenv install --list
. 注意:您可以使用命令
rbenv install --list
查看其他可用版本。
Lastly, leaves the directory, enter it again, and run the following commands: 最后,离开目录,再次输入目录,然后运行以下命令:
rbenv install jruby-9.1.7.0
gem install bundler # to install the bundler gem in the context of your new JRuby 9.1.7.0
bundle install # to install the gems listed in your Gemfile
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.