Jeff Barr

Reading


    Flashback
some time ago

Read

To Read

Posts

January 20, 07:41 PM

Recently I ran into an issue trying to deploy to the Heroku Cedar stack for my (in progress) app, Mocknote. I developed the app locally with Sqlite3, using Sinatra and DataMapper.
Heroku complained about my Gemfile.lock missing the dm-postgres-adapter, but I was unable to install the gem locally. I resolved this conundrum by adding this to my Gemfile:


group :production do
gem 'dm-postgres-adapter'
end

I then ran this:

bundle install --without production

I was then able to successfully deploy to Heroku.

January 20, 07:40 PM

Recently I ran into an issue trying to deploy to the Heroku Cedar stack for my (in progress) app, Mocknote. I developed the app locally with Sqlite3, using Sinatra and DataMapper.
Heroku complained about my Gemfile.lock missing the dm-postgres-adapter, but I was unable to install the gem locally. I resolved this conundrum by adding this to my Gemfile:


group :production do
gem 'dm-postgres-adapter'
end

I then ran this:

bundle install --without production

I was then able to successfully deploy to Heroku.

November 26, 05:01 AM

Don’t hire people who don’t hack. There: don’t tell me I never gave you nothing.

August 13, 07:31 PM

The tree command is, sadly, missing from Mac OSX – but here’s a quick and dirty way to replicate it on OSX. You could of course use MacVIm and NERDTree, but where’s the fun in that?

find . -print | sed -e ‘s;[^/]*/;|____;g;s;____|; |;g’

August 13, 07:24 PM

A while back I did a little experiment with building a ruby gem – the result was Regexhelper. You can check out the gem on Rubygems.org, or check out the source at Githu.com. Of course, you can install by by running ‘gem install regexhelper’ if you’re so inclined. As of now its been downloaded 45 times.

I used a the jeweler gem to help create regexhelper. Right now the gem is pretty empty, and probably very amateurish, but I plan on updating and cleaning it up as soon as possible.

May 12, 03:44 PM

vi .bashrc

is for current user only.

sudo vi /etc/bash.bashrc

is for all users – hence the sudo.

in .bashrc, add:

export PS1=”\e[0;34m[\u@\h \W]\$ \e[m”

to permanently change the bash prompt color.

List of Color codes:

  • Black 0;30
  • Blue 0;34
  • Green 0;32
  • Cyan 0;36
  • Red 0;31
  • Purple 0;35
  • Brown 0;33
  • Blue 0;34
  • Green 0;32
  • Cyan 0;36
  • Red 0;31
  • Purple 0;35
  • Brown 0;33

Replace digit 0 with 1 to get light color version.

May 10, 11:58 PM

Just for the sake of remembering:
After installing MySQL via Macports (which installs mySQL to a different place than you’d expect), install the MySQL gem with:

sudo env ARCHFLAGS=”-arch i386″ gem install mysql — –with-mysql-config=/opt/local/bin/mysql_config5

I finally remembered after I found my bookmark for Mark Turner (amerine.net)’s post on installing Rails 3/Ruby 1.9.2.

April 16, 04:54 PM

While learning Rails, I’ve come across a fair number of really interesting subsets/addons to Rails. This is a list of the ones I plan to investigate in greater detail:

  • Sinatra – Super simple and quick rails app setup – it doesn’t get much easier than this:

    require ‘sinatra’

    get ‘/’ do
    “Hello World!”
    end

    I love the way Sinatra does routing, and the erb :erbname syntax just makes sense right off the bat. Also is supposed to work well with heroku, though I haven’t goten that far yet.

  • Refinery – Also super-quick and easy Gem, but builds out a bare-bones but extensible CMS/blogging engine. COWPU and Bend.rb are using it during the weekly hack night in Bend to build hot sexy pizza websites.
  • Coffeescript – Coffeescript is a kind of Ruby-ish language that compiles into javascript, and as of Rails 3.1 will come bundled with rails. I like coffeescript because I’m a dork who can’t type and I always mess up javascript, which is then just a PITA to debug.

April 09, 05:28 AM

Heroku is pretty cool: a free host for your rails apps that also works really well with git/github. Since my current hosting has some pretty odd hosting for rails, I’ll be using heroku to host my demo apps. While adding a demo app, I received this error:

heroku keys:add …/custom_require.rb:36:in `require’: no such file to load — readline (LoadError)

According to dirk.net, this error is due to missing libraries after installing ruby from source.

The provided fix worked just fine for me:

sudo apt-get install libncurses5-dev
sudo apt-get install libreadline5-dev

After that, I cd to where I unpacked the Ruby source and ran:

ruby extconf.rb
make
sudo make install

heroku keys:add worked fine from there. Thanks to dirk.net for the fix.

April 09, 04:42 AM

In my quest to get ruby on rails up and running on all three OSes tat live in my house (windows, mac OSX leopard, linux), I ran into a snag in the install process on Ubuntu 10.04.

Ruby v 1.8.7 was alive and well, however, following the steps at rubyonrails.org, when I tried to update gem:
sudo gem install rails
OR
sudo gem update –system
I received this error:

/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require’:
no such file to load — zlib (LoadError)

Oddly enough, I received the same error when trying to create a rails app or start the rails server – even though rails *seemed* to be installed. Mysterious!
I had previously installed ruby via the synaptic package manager, gotten the same message, then tried again via sudo apt-get install ruby-full build-essential, none of which had relieved the issue.
So, searching the googlenet, I came across this post:
http://thoughtsincomputation.com/posts/ubuntu-and-ruby-191-zlib-missing
He had run into the same issue, and noted that the actual missing library was called zlib1g. I checked synaptic, and I had that installed – but, he noted that he had compiled Ruby from source, which I hadn’t tried. So, following his instructions:
sudo apt-get install zlib1g-dev

I then went to http://www.ruby-lang.org/en/downloads/ and got the source for version 1.9.2 (since this was the version I’m currently running on windows). I compiled ruby1.9.2 from source, and the problem was resolved.

Profile

Software Support Engineer at G5 Search Marketing
Internet | Eugene, Oregon Area, US

Summary

I enjoy building and fixing things. Sometimes I use words, sometimes I use code; most days I use bundle exec rails c.
Specialties: Developer: Ruby/Ruby on Rails, Java, PHP, Javascript, HTML

Experience

  • Jun 2011 - Present
    Software Support Engineer / G5 Search Marketing
  • May 2010 - Jun 2011
    Head Nerd in Charge / Web Development Freelancer
    Freelance web design/development + SEO + marketroidals
  • Mar 2003 - May 2010
    Java Developer / Streamray
    Sr. Java Developer, Project Manager, Developer
  • 2005 - 2007
    Project Manager / FriendFinder Networks Inc.

Additional Information

Websites:

Uploads

Favorites

abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz