srushti / goldberg

Goldberg is a lightweight CI server written in Ruby which worries about Bundler & RVM so that you don't have to.
Other
243 stars 29 forks source link

Rake is not run with bundle exec #75

Closed localshred closed 12 years ago

localshred commented 13 years ago

I am encountering a simple issue where rake is not run with bundle exec with ruins the purpose of using bundler in the first place. I will attempt to find where the command is run and supply a patch.

The Gemfile's dependencies are satisfied
rake aborted!
You have already activated rspec-core 2.5.2, but your Gemfile requires rspec-core 2.4.0. Consider using bundle exec.
/home/ci/.goldberg/projects/amigo-master/code/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
(in /home/ci/.goldberg/projects/amigo-master/code)
localshred commented 13 years ago

I attempted to add bundle exec to the build_command in Build#run, but this produced no output as I reported in issue #74.

srushti commented 13 years ago

Generally, rake will load up bundler before running anything else. The only thing you get out of running bundle exec rake is to make sure the correct version of rake itself is picked up (say, you've installed 0.9.0 which is broken on rails, but you want to run 0.8.7 which you've mentioned in your Gemfile). The problem is this command fails if rake isn't in your Gemfile (or in your Gemfile.lock as a dependency, as is the case in rails projects). I'm not sure we want to go to the effort of examining the Gemfile.lock before deciding to run bundle exec rake or just plain rake. Considering your issue specifically, can I assume that when you run locally rake you get the error you've indicated in your first comment, but when you run bundle exec rake it works fine? Based on what I know that shouldn't happen, but if it is happening I might ask for more information about your setup.

srushti commented 12 years ago

Fixed in 7ad90e35 since you can specify "use_bundle_exec" in your configuration.

localshred commented 12 years ago

Thank you.