<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <id>tag:underpantsgnome.com,2005://feed</id>
  <link rel="alternate" type="text/html" href="http://underpantsgnome.com"/>
  <link rel="self" type="application/atom+xml" href="http://underpantsgnome.com//feed"/>
  <title>UnderpantsGnome</title>
  <updated>2012-02-01T20:18:54-06:00</updated>
  <entry>
    <id>tag:underpantsgnome.com,2005:Jabe::Entry/1087</id>
    <published>2012-02-01T20:18:54-06:00</published>
    <updated>2012-02-01T20:18:54-06:00</updated>
    <link rel="alternate" type="text/html" href="http://underpantsgnome.com/2012/02/01/jabe-0-7-0-oops-0-6-x-sucked"/>
    <title>JABE 0.7.0 oops 0.6.x sucked</title>
    <content type="html">&lt;p&gt;So the 0.6.x series was a mess and a learning experience. I&amp;#8217;m Ok with that, are you?&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve resolved issues in the asset pipeline, and in the comment notification mailer.&lt;/p&gt;
&lt;p&gt;Who knows what else I&amp;#8217;ve dug up.&lt;/p&gt;</content>
    <author>
      <name>UnderpantsGnome</name>
    </author>
  </entry>
  <entry>
    <id>tag:underpantsgnome.com,2005:Jabe::Entry/1086</id>
    <published>2012-01-31T22:19:27-06:00</published>
    <updated>2012-01-31T22:19:27-06:00</updated>
    <link rel="alternate" type="text/html" href="http://underpantsgnome.com/2012/01/31/jabe-0-6-1-rails-3-1-and-mountable"/>
    <title>JABE 0.6.1, Rails 3.1+ and mountable</title>
    <content type="html">&lt;p&gt;So I finally got around to updating &lt;a href="https://github.com/pixels-and-bits/jabe"&gt;&lt;span class="caps"&gt;JABE&lt;/span&gt;&lt;/a&gt; yeah I know its been forever (about a year).&lt;/p&gt;
&lt;p&gt;Well it now plays nice with Rails 3.1+ and you can now mount it to any path you want instead of just the root.&lt;/p&gt;</content>
    <author>
      <name>UnderpantsGnome</name>
    </author>
  </entry>
  <entry>
    <id>tag:underpantsgnome.com,2005:Jabe::Entry/4</id>
    <published>2011-05-11T17:26:48-05:00</published>
    <updated>2012-02-06T17:55:17-06:00</updated>
    <link rel="alternate" type="text/html" href="http://underpantsgnome.com/2011/05/11/sass-on-heroku-or-any-generated-files-for-that-matter"/>
    <title>Sass on Heroku or any generated files for that matter</title>
    <content type="html">&lt;p&gt;Here&amp;#8217;s yet another take on how to handle generated files when you are deploying to &lt;a href="http://www.heroku.com/"&gt;Heroku&lt;/a&gt; while keeping your git repo free of the artifacts.&lt;/p&gt;
&lt;p&gt;We deploy using a rake task &lt;code&gt;rake deploy&lt;/code&gt; that was generating Jammit files, committing them to the repo and pushing them up. This works fine, but adds &amp;#8220;junk&amp;#8221; commits to your repo and even the occasional merge conflict from the generated files.&lt;/p&gt;
&lt;p&gt;Since Heroku doesn&amp;#8217;t care what you push to it as long as it is in the master branch on their end, why not generate the assets in a throwaway branch and push that up?&lt;/p&gt;
&lt;p&gt;Here are the basic commands you would run in the shell. Wrap them up in a rake task that fits your project and off you go.&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;# send it up to github
git push origin master 

# get rid of the branch if it exists (it shouldn't)
git branch -D deploy

# generate Jammit, Sass, etc. files
rake cache_assets 

# push it up to heroku, need force since it's a different branch every time
git push heroku deploy:master --force 

git checkout master

# get rid of the old branch
git branch -D deploy 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As long as everybody uses the rake task to deploy you shouldn&amp;#8217;t have any problems with this technique.&lt;/p&gt;</content>
    <author>
      <name>UnderpantsGnome</name>
    </author>
  </entry>
  <entry>
    <id>tag:underpantsgnome.com,2005:Jabe::Entry/3</id>
    <published>2011-05-04T16:34:44-05:00</published>
    <updated>2011-05-04T16:36:59-05:00</updated>
    <link rel="alternate" type="text/html" href="http://underpantsgnome.com/2011/05/04/queue-failed-solr-calls-with-delayedjob"/>
    <title>Queue failed Solr calls with Delayed::Job</title>
    <content type="html">&lt;p&gt;We are using websolr.com from one of our Heroku apps and from time to time we see connection errors. This is disruptive in the UI. One option was to move all of the Solr calls to DJ tasks, but I didn&amp;#8217;t want to have a ton of stuff in the DJ queue. The other option was to make a variation of &lt;a href="https://github.com/outoftime/sunspot/blob/master/sunspot/lib/sunspot/session_proxy/silent_fail_session_proxy.rb"&gt;SilentFailSessionProxy&lt;/a&gt; and have it queue up the jobs we cared about, specifically index and remove and raise the others.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://gist.github.com/956075"&gt;Here&lt;/a&gt; is the current version of this.&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;require 'sunspot/session_proxy/silent_fail_session_proxy'

module Sunspot
  module SessionProxy
    class QueueFailureSessionProxy &amp;lt; Sunspot::SessionProxy::SilentFailSessionProxy
      QUEUE_METHODS = [:index!, :index, :remove!, :remove]

      def rescued_exception(method_name, ex, klass)
        raise ex unless ::Rails.env.production?

        if klass &amp;amp;&amp;amp; QUEUE_METHODS.include?(method_name)
          HoptoadNotifier.notify(
            :error_class =&amp;gt; "Solr Exception",
            :error_message =&amp;gt; "Solr Exception: #{ex.message}",
            :parameters =&amp;gt; { :model =&amp;gt; klass, :method =&amp;gt; method_name }
          ) if defined?(HoptoadNotifier)

          klass.delay.index! if method_name.to_s.match('index')
          klass.delay.remove_from_index! if method_name.to_s.match('remove')
        else
          raise ex
        end
      end

      SUPPORTED_METHODS.each do |method|
        module_eval(&amp;lt;&amp;lt;-RUBY)
          def #{method}(*args, &amp;amp;block)
            begin
              search_session.#{method}(*args, &amp;amp;block)
            rescue =&amp;gt; ex
              self.rescued_exception(:#{method}, ex, args.first)
            end
          end
        RUBY
      end

    end
  end
end

Sunspot.session = Sunspot::SessionProxy::QueueFailureSessionProxy.new(Sunspot.session)
&lt;/code&gt;&lt;/pre&gt;</content>
    <author>
      <name>UnderpantsGnome</name>
    </author>
  </entry>
  <entry>
    <id>tag:underpantsgnome.com,2005:Jabe::Entry/2</id>
    <published>2011-01-05T17:56:15-06:00</published>
    <updated>2011-01-05T19:18:23-06:00</updated>
    <link rel="alternate" type="text/html" href="http://underpantsgnome.com/2011/01/05/how-to-install-private-gems-on-heroku"/>
    <title>How to install private gems on heroku</title>
    <content type="html">&lt;p&gt;Scenario: I have to setup a staging app on Heroku. Sounds pretty simple, should take an hour tops, right? Think again.&lt;/p&gt;
&lt;p&gt;Mix in a gem from a private git repo and it gets messy. If the gem isn&amp;#8217;t installed via version but with a commit ref you get even more fun.&lt;/p&gt;
&lt;p&gt;Setup the app on Heroku as you normally would, then try to deploy. Everything looks good, until it tries to fetch the private gem. Then&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;git push heroku staging:master
-----&amp;gt; Heroku receiving push
-----&amp;gt; Rails app detected
-----&amp;gt; Detected Rails is not set to serve static_assets
       Installing rails3_serve_static_assets... done
-----&amp;gt; Gemfile detected, running Bundler version 1.0.3
       Unresolved dependencies detected; Installing...
...

&amp;lt;tries to install private gem&amp;gt;

Permission denied (publickey).
fatal: The remote end hung up unexpectedly
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Hrm&amp;#8230; Poke around the google some and find I&amp;#8217;m not the only one. See references to an ~/.ssh/config that looks something like&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;Host heroku.com
  HostName heroku.com
  User git
  ForwardAgent yes
  IdentitiesOnly yes
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Sounds reasonable. Nope, no luck. More time with google and it would seem that Heroku doesn&amp;#8217;t pass your keys out the other side. Not sure if they have a specific reason for it or it&amp;#8217;s just the default sshd_config.&lt;/p&gt;
&lt;p&gt;Ok, that&amp;#8217;s not going to work. Lets try dropping the gem in &lt;code&gt;vendor/cache&lt;/code&gt; and see if that helps. Oh, there isn&amp;#8217;t an actual gem to cache. Lets grab the one in bundler. Nope that wont work either.&lt;/p&gt;
&lt;p&gt;Off to build the gem so I can place it in &lt;code&gt;vendor/cache&lt;/code&gt;.&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;cd ../my_gem
rake build
cp pkg/my_gem-0.0.2.gem ../rails_app/vendor/cache
cd ../rails_app
bundle install
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span class="caps"&gt;WTF&lt;/span&gt;!? Oh, it saw one gem in the cache dir, I &lt;em&gt;must&lt;/em&gt; want them all in there, right?? No, no I don&amp;#8217;t.&lt;/p&gt;
&lt;p&gt;Ok, well let&amp;#8217;s place the gem in the app in a place I can get to it with bundler but it wont randomly trigger some other unwanted behavior.&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;gem install ../my_gem/pkg/my_gem-0.0.2.gem
gem unpack my_gem -v 0.0.2 --target vendor/private_gems
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ok now I update my Gemfile to look like&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;gem 'my_gem',
  :path =&amp;gt; 'vendor/private_gems/my_gem-0.0.2'
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So far it seems happy.&lt;/p&gt;
&lt;p&gt;Though I have seen some really strange issues with it randomly Throwing the &lt;code&gt;Gemfile.lock - Heroku has a read-only filesystem&lt;/code&gt; error which would make perfect sense other than the fact that the error came from running &lt;code&gt;heroku rake db:migrate&lt;/code&gt; right after a successful push.&lt;/p&gt;</content>
    <author>
      <name>UnderpantsGnome</name>
    </author>
  </entry>
  <entry>
    <id>tag:underpantsgnome.com,2005:Jabe::Entry/1</id>
    <published>2011-01-03T15:17:15-06:00</published>
    <updated>2011-01-03T15:17:56-06:00</updated>
    <link rel="alternate" type="text/html" href="http://underpantsgnome.com/2010/12/31/new-home-new-engine"/>
    <title>New home, new engine</title>
    <content type="html">&lt;p&gt;If you are reading this the site has moved to &lt;a href="http://heroku.com"&gt;Heroku&lt;/a&gt; and is now powered by &lt;a href="http://github.com/pixels-and-bits/jabe"&gt;&lt;span class="caps"&gt;JABE&lt;/span&gt;&lt;/a&gt; in addition to the info on github, more info on &lt;span class="caps"&gt;JABE&lt;/span&gt; coming soon here.&lt;/p&gt;</content>
    <author>
      <name>UnderpantsGnome</name>
    </author>
  </entry>
  <entry>
    <id>tag:underpantsgnome.com,2005:Jabe::Entry/1084</id>
    <published>2010-10-08T05:34:27-05:00</published>
    <updated>2011-01-04T00:24:43-06:00</updated>
    <link rel="alternate" type="text/html" href="http://underpantsgnome.com/2010/10/08/snow-leopard-passenger-3-passengerpane-and-stock-apache"/>
    <title>Snow Leopard, Passenger 3, PassengerPane and Stock Apache</title>
    <content type="html">&lt;p&gt;I finally decided to start using Passenger and the stock Apache in OS X Snow Leopard.&lt;/p&gt;
&lt;p&gt;Here are the steps I followed, from memory, so if they are missing anything please let me know.&lt;/p&gt;
&lt;p&gt;install &lt;a href="http://github.com/alloy/passengerpane"&gt;PassengerPane&lt;/a&gt;&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;rvm install ree
rvm ree
rvm gemset create APP_NAME
gem install passenger
rvmsudo passenger-install-apache2-module
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Add an .rvmrc file&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;rvm --rvmrc --create ree@APP_NAME&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Find the gems info&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;rvm ree@APP_NAME
rvm info | grep GEM
  GEM_HOME:     "/Users/mmoen/.rvm/gems/ree-1.8.7-2010.02@APP_NAME"
  GEM_PATH:     "/Users/mmoen/.rvm/gems/ree-1.8.7-2010.02@APP_NAME:/Users/mmoen/.rvm/gems/ree-1.8.7-2010.02@global"
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;add those to the /etc/apache2/passenger_pane_vhosts/APP_NAME.local.conf&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;SetEnv GEM_HOME /Users/mmoen/.rvm/gems/ree-1.8.7-2010.02@showcase
SetEnv GEM_PATH /Users/mmoen/.rvm/gems/ree-1.8.7-2010.02@showcase:/Users/mmoen/.rvm/gems/ree-1.8.7-2010.02@global
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Make sure the envs are setup in /etc/apache2/passenger_pane_vhosts/APP_NAME.local.conf&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;RailsEnv development
RackEnv development
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you make changes to routing or other places that don&amp;#8217;t autoload, you will need to restart the instance&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;touch tmp/restart.txt&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Known issues:&lt;/p&gt;
&lt;p&gt;If you are running a Rails 2.x app this way you will have to delete config.ru before starting or restarting the app. Otherwise it messes up Rails.env.&lt;/p&gt;
&lt;p&gt;And as always, feel free to tell me I&amp;#8217;m way off or if you have any input, please share it.&lt;/p&gt;
&lt;p&gt;[edit] Update .rvmrc creation per Wayne&amp;#8217;s suggestion&lt;/p&gt;</content>
    <author>
      <name>UnderpantsGnome</name>
    </author>
  </entry>
  <entry>
    <id>tag:underpantsgnome.com,2005:Jabe::Entry/972</id>
    <published>2010-03-23T16:01:14-05:00</published>
    <updated>2010-03-23T16:01:36-05:00</updated>
    <link rel="alternate" type="text/html" href="http://underpantsgnome.com/2010/03/23/acktmbundle"/>
    <title>Ack.tmBundle</title>
    <content type="html">&lt;p&gt;If you are a Textmate user and you were tired of Find in Project being a dog, so you started using Grep in Project and even it was getting slow. You absolutely owe it to yourself to check out &lt;a href="http://github.com/protocool/ack-tmbundle"&gt;Ack in Project&lt;/a&gt;. It is ridiculously fast.&lt;/p&gt;</content>
    <author>
      <name>UnderpantsGnome</name>
    </author>
  </entry>
  <entry>
    <id>tag:underpantsgnome.com,2005:Jabe::Entry/966</id>
    <published>2010-02-20T01:59:13-06:00</published>
    <updated>2010-02-20T01:59:53-06:00</updated>
    <link rel="alternate" type="text/html" href="http://underpantsgnome.com/2010/02/20/rvm-friendly-textmate-bundles"/>
    <title>rvm friendly TextMate bundles</title>
    <content type="html">&lt;p&gt;I forked and modified the &lt;a href="http://cukes.info/"&gt;Cucumber&lt;/a&gt; and &lt;a href="http://rvm.beginrescueend.com/"&gt;RSpec&lt;/a&gt; &lt;a href="http://macromates.com/"&gt;TextMate&lt;/a&gt; bundles to setup the &lt;a href="http://rvm.beginrescueend.com/"&gt;rvm&lt;/a&gt; environment based on an &lt;a href="http://rvm.beginrescueend.com/workflow/rvmrc/"&gt;.rvmrc&lt;/a&gt; in your project directory.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://github.com/UnderpantsGnome/cucumber-tmbundle"&gt;Cucumber Bundle&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://github.com/UnderpantsGnome/rspec-tmbundle"&gt;RSpec Bundle&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Enjoy. Let me know if you find any quirks.&lt;/p&gt;</content>
    <author>
      <name>UnderpantsGnome</name>
    </author>
  </entry>
  <entry>
    <id>tag:underpantsgnome.com,2005:Jabe::Entry/965</id>
    <published>2010-02-19T23:22:08-06:00</published>
    <updated>2010-02-19T23:23:19-06:00</updated>
    <link rel="alternate" type="text/html" href="http://underpantsgnome.com/2010/02/19/rvm-gemsets-textmate-yay-2"/>
    <title>rvm + gemsets + TextMate == yay! * 2</title>
    <content type="html">&lt;p&gt;Ok so in my last post I mentioned I wasn&amp;#8217;t able to find a way to automatically use an existing .rvmrc file. I spent some time with it again this afternoon and was able to get it to work. So now if you are using TextMate and you want to run a ruby script that uses your rvm environment all you have to do is edit the commands you use and replace the #! and add a couple lines. The odd thing is this is pretty much exactly what I was trying before, though on a different machine.&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;#!/usr/bin/env bash

[[ -f "$HOME/.rvm/scripts/rvm" ]] &amp;amp;&amp;amp; . $HOME/.rvm/scripts/rvm
[[ -f "$TM_PROJECT_DIRECTORY/.rvmrc" ]] &amp;amp;&amp;amp; . $TM_PROJECT_DIRECTORY/.rvmrc
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And that&amp;#8217;s it, you get your rvm config in TextMate.&lt;/p&gt;</content>
    <author>
      <name>UnderpantsGnome</name>
    </author>
  </entry>
</feed>

