How to run "bundle exec" without gems in production group?

2,461 views
Skip to first unread message

tadatoshi

unread,
Jan 7, 2011, 7:08:39 PM1/7/11
to ruby-bundler
Hi,

In Gemfile, I specified :production group with the gems that are
needed in the production server.

When I executed "bundle exec rspec spec", it failed with an error
"Could not find gem ...".
Neither "bundle --help" nor online man page (http://gembundler.com/man/
bundle-exec.1.html) doesn't give any hint.

So I tried to execute "bundle exec --without production rspec spec".
Then I got an error "bundler: command not found: --without".

Then I tried "bundle --without production exec rspec spec". Then it
just executed "bundle install --without production" and didn't execute
the rspec command at all.

How can I run "bundle exec" without requiring the gems specified
in :production group?

Thank you in advance.

Tadatoshi

Yehuda Katz

unread,
Jan 7, 2011, 10:34:27 PM1/7/11
to ruby-bundler
Installing the bundle and exec'ing are two separate steps.

1. bundle install --without production
2. bundle exec rspec spec

You could also use binstubs:

1. bundle install --without production --binstubs
2. bin/rspec spec

The key is that when you use --without, it gets remembered for all future calls in the same application on the same machine.

Yehuda Katz
Architect | Strobe
(ph) 718.877.1325



--
You received this message because you are subscribed to the Google Groups "ruby-bundler" group.
To post to this group, send email to ruby-b...@googlegroups.com.
To unsubscribe from this group, send email to ruby-bundler...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ruby-bundler?hl=en.


Reply all
Reply to author
Forward
0 new messages