开发者

How to use bundler gem binaries in path

开发者 https://www.devze.com 2022-12-18 09:13 出处:网络
I just started using bundler for gem packaging in vendor/. The problem is with certain gems (like rspec and cucumber) that have binaries. The binary path that is under my_app/vendor/gems/ruby/1.8/...c

I just started using bundler for gem packaging in vendor/. The problem is with certain gems (like rspec and cucumber) that have binaries. The binary path that is under my_app/vendor/gems/ruby/1.8/...cucumber-0.6.2/bin/ is 开发者_如何学Gonot in my path, therefore when I go to run cucumber i get command cannot be found.

What is the easiest way to execute the bundled gem binaries from within the app rather than adding a large number of folders to my path?

Thanks


Newer version of bundler have an "exec" action. So for cucumber it would be:

bundle exec cucumber


OK, so symlinking was in fact a daft idea. This question did get me thinking though, and I found this: http://litanyagainstfear.com/blog/2009/10/14/gem-bundler-is-the-future/

Bundler will also dump gem executables in your Rails.root/bin directory. This means you can then use bin/rake, for example.

so, from the Rails root, does bin/cucumber work?

0

精彩评论

暂无评论...
验证码 换一张
取 消