Ruby gem names with appended ruby version

做~自己de王妃 提交于 2019-12-08 08:32:04

问题


Ruby gem names are really throwing me off. For example if install a gem called jade, a wrapper script is placed at /usr/bin/jade1.9 on some systems and at /usr/bin/jade on others. I'm curious if anyone has a recommendation on how I can use jade in scripts without writing some hackish code that guesses the correct gem name. The naming also makes it difficult to write documentation for less savvy users. Is there a simple way of making gems install with same name on all systems?

To elaborate a bit:

gem install jade #jade is something I made up
ls /usr/bin/|grep "jade"
> jade1.9

When I want to execute:

jade --dosomething

I actually have to run

jade1.9 --dosomething

I've noticed certain gems such as rake are installed at both /usr/bin/rake and /usr/bin/rake1.9 with neither being a symlink and both files having the same md5sum.

I am trying to understand why gems get the ruby version appended on some systems and how I can make install without the trailing version number.

A list of some example of gems that install an executable:

ls /usr/bin/|grep "1.9"
amalgalite-pack1.9
bundle1.9
crate1.9
erb1.9
gem1.9
irb1.9
minitar1.9
rake1.9
rdoc1.9
ri1.9
rlock1.9
ruby1.9
rubyscript2exe1.9
testrb1.9

来源:https://stackoverflow.com/questions/19798660/ruby-gem-names-with-appended-ruby-version

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!