views:

922

answers:

2

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 not 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

A: 

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?

Rodreegez
I thought about doing that, it just seems odd to have a git repository folder symlinked into usr/local/bin
Sean Chambers
that does! I actually know Nick and had read his blog post before but didn't pick up on that part. Thanks!
Sean Chambers
Unfortunately this is no longer accurate in bundler 0.9. But if you're still using bundler 0.8, this should work great.
Joseph Holsten
+3  A: 

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

bundle exec cucumber