<div dir="ltr">Really good point Sam!<div><br></div><div>I'm not sure what the virtue of removing the `cd` step from your cronjob is. It sounds way more trouble than it's worth. However this was interesting to think about the answers were great also.</div><div><br></div><div>Gerhard - Not using `bundle exec` in production seems like introducing an unnecessary discrepancy between environments. I'm sure the core point you're making is that production servers should have no extraneous packages installed but I'm just not sure enforcing that by giving up isolation is a good thing.</div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><br>Stephen Best<br><div><br></div><div><a href="http://theaudaciouscodeexperiment.com" target="_blank">theaudaciouscodeexperiment.com</a><br><a href="http://github.com/bestie" target="_blank">github.com/bestie</a><br>@thebestie</div></div></div>
<br><div class="gmail_quote">On 9 October 2014 10:11, Sam Phippen <span dir="ltr"><<a href="mailto:samphippen@googlemail.com" target="_blank">samphippen@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">I heard <a href="http://12factor.net/dependencies" target="_blank">http://12factor.net/dependencies</a> 12 factor apps were a pretty good idea.<div><div class="h5"><div><br></div><div><div><div>On 8 Oct 2014, at 19:12, Gerhard Lazu <<a href="mailto:gerhard@lazu.co.uk" target="_blank">gerhard@lazu.co.uk</a>> wrote:</div><br><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;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing: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" target="_blank">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> </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> </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> </span>#!/usr/bin/env ruby<br>   <span> </span>#<br>   <span> </span># This file was generated by Bundler.<br>   <span> </span>#<br>   <span> </span># The application 'rake' is installed as part of a gem, and<br>   <span> </span># this file is here to facilitate running it.<br>   <span> </span>#<br><br>   <span> </span>require 'pathname'<br>   <span> </span>ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",<br>     <span> </span>Pathname.new(__FILE__).realpath)<br><br>   <span> </span>require 'rubygems'<br>   <span> </span>require 'bundler/setup'<br><br>   <span> </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> </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> </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> </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> </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> </span><a href="https://github.com/gerhard" target="_blank">Github</a> </font><a href="http://gerhard.lazu.co.uk/" style="font-family:arial,helvetica,sans-serif" target="_blank">Blog</a></font></div><br></blockquote></div><br><br>--<span> </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> </span><a href="https://github.com/gerhard" target="_blank">Github</a> </font><a href="http://gerhard.lazu.co.uk/" style="font-family:arial,helvetica,sans-serif" target="_blank">Blog</a></font></div><br>_______________________________________________<br>Chat mailing list<br><a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br>Archives:<span> </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> </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> </span><a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a></div></blockquote></div><br></div></div></div></div><br>_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
Archives: <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: <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: <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
<br></blockquote></div><br></div></div>