<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">I heard <a href="http://12factor.net/dependencies">http://12factor.net/dependencies</a> 12 factor apps were a pretty good idea.<div><br></div><div><div style=""><div>On 8 Oct 2014, at 19:12, Gerhard Lazu <<a href="mailto:gerhard@lazu.co.uk">gerhard@lazu.co.uk</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">... and by "bundle exec" I mean bundler/binstubs/rvm/rbenv/chr<span></span>uby, the whole lot.<br><div><br>On Wednesday, 8 October 2014, Gerhard Lazu <<a href="mailto:gerhard@lazu.co.uk">gerhard@lazu.co.uk</a>> wrote:<br><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">bundle exec usage should stop at your CI/CD.<div><br></div><div>Production should always have a single version of the correct dependency (whether it's the Ruby binary, gem or C extension). </div><div><br></div><div><span></span>Heroku Ruby app slugs and CloudFoundry Ruby app droplets are good examples of this principle in practice.<div><div><br></div><div>Gerhard<br><br>On Wednesday, 8 October 2014, Andrew Stewart <<a>boss@airbladesoftware.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">Hello!<br><br>For a long time I have had on my server a cronjob which runs a rake task:<br><br>   <span class="Apple-converted-space"> </span>42 * * * * RAILS_ENV=production cd /path/to/my/app && bundle exec rake blah<br><br>Recently I decided to get with the program and use a binstub instead:<br><br>   <span class="Apple-converted-space"> </span>42 * * * * RAILS_ENV=production /path/to/my/app/bin/rake blah<br><br>But it fails with: "rake aborted! No Rakefile found".  Naturally there is a Rakefile at /path/to/my/app.<br><br>My rake binstub is the one that comes with Rails 4:<br><br>   <a href="https://github.com/rails/rails/commit/009873aec89a4b843b41accf616b42b7a9917ba8#diff-15" target="_blank">https://github.com/rails/rails/commit/009873aec89a4b843b41accf616b42b7a9917ba8#diff-15</a><br><br>– not the one that Bundler would generate:<br><br>   <span class="Apple-converted-space"> </span>#!/usr/bin/env ruby<br>   <span class="Apple-converted-space"> </span>#<br>   <span class="Apple-converted-space"> </span># This file was generated by Bundler.<br>   <span class="Apple-converted-space"> </span>#<br>   <span class="Apple-converted-space"> </span># The application 'rake' is installed as part of a gem, and<br>   <span class="Apple-converted-space"> </span># this file is here to facilitate running it.<br>   <span class="Apple-converted-space"> </span>#<br><br>   <span class="Apple-converted-space"> </span>require 'pathname'<br>   <span class="Apple-converted-space"> </span>ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",<br>     <span class="Apple-converted-space"> </span>Pathname.new(__FILE__).realpath)<br><br>   <span class="Apple-converted-space"> </span>require 'rubygems'<br>   <span class="Apple-converted-space"> </span>require 'bundler/setup'<br><br>   <span class="Apple-converted-space"> </span>load Gem.bin_path('rake', 'rake')<br><br>After doing some research on this I learned it's controversial, a surprise for Rails ;)<br><br>Now that the dust has settled, what's the generally recommended approach?  Keep the Rails-generated binstub for rake, and cronjobs that cd into the app directory, or go for a bundler-generated binstub (which presumably works from anywhere)?<br><br>Thanks in advance,<br><br>Andy Stewart<br>_______________________________________________<br>Chat mailing list<br><a>Chat@lists.lrug.org</a><br>Archives:<span class="Apple-converted-space"> </span><a href="http://lists.lrug.org/pipermail/chat-lrug.org" target="_blank">http://lists.lrug.org/pipermail/chat-lrug.org</a><br>Manage your subscription:<span class="Apple-converted-space"> </span><a href="http://lists.lrug.org/options.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/options.cgi/chat-lrug.org</a><br>List info:<span class="Apple-converted-space"> </span><a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br></blockquote></div></div></div><br><br>--<span class="Apple-converted-space"> </span><br><div dir="ltr"><br><hr style="font-family: arial, helvetica, sans-serif;"><font color="#3333ff"><font face="arial, helvetica, sans-serif"><a href="http://twitter.com/#!/gerhardlazu" target="_blank">Twitter</a><span class="Apple-converted-space"> </span><a href="https://github.com/gerhard" target="_blank">Github</a> </font><a href="http://gerhard.lazu.co.uk/" target="_blank" style="font-family: arial, helvetica, sans-serif;">Blog</a></font></div><br></blockquote></div><br><br>--<span class="Apple-converted-space"> </span><br><div dir="ltr"><br><hr style="font-family: arial, helvetica, sans-serif;"><font color="#3333ff"><font face="arial, helvetica, sans-serif"><a href="http://twitter.com/#!/gerhardlazu" target="_blank">Twitter</a><span class="Apple-converted-space"> </span><a href="https://github.com/gerhard" target="_blank">Github</a> </font><a href="http://gerhard.lazu.co.uk/" target="_blank" style="font-family: arial, helvetica, sans-serif;">Blog</a></font></div><br>_______________________________________________<br>Chat mailing list<br><a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>Archives:<span class="Apple-converted-space"> </span><a href="http://lists.lrug.org/pipermail/chat-lrug.org">http://lists.lrug.org/pipermail/chat-lrug.org</a><br>Manage your subscription:<span class="Apple-converted-space"> </span><a href="http://lists.lrug.org/options.cgi/chat-lrug.org">http://lists.lrug.org/options.cgi/chat-lrug.org</a><br>List info:<span class="Apple-converted-space"> </span><a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a></div></blockquote></div><br></div></body></html>