Commit 9501ac70 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Do not use bundler to run foreman, because:

then the process could be using the Gemfile located on the root
directory, which only has foreman as the dependency. Later on even if we
set BUNDLE_GEMFILE to another Gemfile, bundler might have already setup
and ignore the new BUNDLE_GEMFILE.

Before this patch, I cannot run the application due to missing `rake`,
but cd into the sub-directory and run from there is running fine.
With this patch ./run could be running fine as well.

I didn't dig into bundler internal to figure this out, but in my
experience, messing around BUNDLE_GEMFILE is not a good idea and we
should try only use bundler for the application, not the wrapping
script. On the other hand, avoid `bundle exec` and prefer
`ruby -r bundler/setup` would also reduce the complexity here.
(avoiding an extra process)

Since foreman is the only dependency in this script, I think there's
little point to use bundler here even if it works. If we really like to
specify the version of foreman, we could also run with like:
`foreman _0.78.0_` or `ruby -S foreman _0.78.0_`, etc. I always use
this before bundler.

Tested with:

* ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
* bundler (1.11.2)
* foreman (0.78.0)
* foreman (0.74.0)
parent c0efed0a
......@@ -16,7 +16,7 @@ print_port() {
}
foreman_start() {
exec env port=${port} bundle exec foreman start "$@"
exec env port=${port} foreman start "$@"
}
db() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment