2013s
Installing the DataMapper gem with Postgres.app
Sep 14, 2013Another install-related entry. This time, I’m attempting to install the Ruby Gem, DataMapper, for a small project - a mini app for pulling S3/Cloudfront download stats for my Verbose (iTunes link) podcast. The app pulls a date range worth of logs from S3, then digests the logs, putting the relevant data into a Postgres database, so they can be mangled at will later.
I’ve installed Postgres.app on my MacBook Air, because I like the icon. I could have homebrew‘ed the database in, but since I don’t use it that often, it’s trivial to remove when bundled into the app. DataMapper has worked well for me in the past, so I’m sticking with it.
The whole reasoning behind using Postgres in the first place is that both AppFog and Heroku support it as their default SQL database. There’s no performance constraints, or scaling requirements here, since this is just a tiny, personal app. The main technology consideration is get-out-of-my-way-and-let-me-get-this-done-for-cheap.
But there’s always something. In this case it’s installing a Ruby gem with native extensions, when the collateral for building those extensions resides in a non-default location.
Making the install work involves using bundle config, an aspect of Bundler I didn’t know about. It allows you to override the arguments to the configure execution for native gem components. You can directly override when installing a gem, or you can register an override that will be stored in your ~/.bundle directory and remembered for future use.
Here’s the incantation that worked for me, for a once-off install:
gem install do_postgres – <br /> –with-pgsql-server-dir=/Applications/Postgres.app/Contents/MacOS <br /> –with-pgsql-server-include=/Applications/Postgres.app/Contents/MacOS/include/server
Installing Erlang and Elixir on OS X Mavericks
Aug 25, 2013Homebrew is my go-to tool for non-App Store or prebuilt app installs on Mac, and has been for ages, just because I’ve found it easier to use than fink or macports. There’s been precious little trouble moving to mavericks, but Erlang is one item that didn’t install smoothly for me. The solution was to add a configure switch to specify a later version of OpenSSL that isn’t installed by default on Mavericks (on beta 3 at least). Right now, brew only supports extra configure switches through altering the brew formula, and I didn’t want to muck about with that.
With thanks to Steve Vinoski for some tips on the configuration of the Erlang source code build:
$ brew install openssl
will get a recent version of OpenSSL that Erlang likes. At the end of the install you’ll get a message
Caveats
This formula is keg-only: so it was not symlinked into /usr/local. Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble. The OpenSSL provided by OS X is too old for some software. Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you’ll need to add to your
build variables: LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
The Erlang source build needs to know about that /usr/local/opt/openssl directory. Go download the Erlang source - if you are intending to install Elixir get the 16B01 version at least. Unpack the source, change into the source directory and issue the build configure like this (line breaks for legibility - paste-able version at this gist).
$ ./configure –disable-hipe
–enable-smp-support
–enable-threads
–enable-kernel-poll
–enable-darwin-64bit
–with-ssl=/usr/local/opt/openssl
Once you’ve configured the build, you might want to skip a couple of things - for example wxWindows and ODBC
$ touch lib/wx/SKIP lib/odbc/SKIP
$ make
$ sudo make install
Check that erl has found the crypto module ok
$ erl
Erlang R16B01 (erts-5.10.2) [source][/source] [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:false]
Eshell V5.10.2 (abort with ^G)
1> crypto:start().
ok
2>
User switch command
–> q
Now for Elixir, it’s just a matter of going back to using homebrew and all should behave as expected.
$ brew install elixir
$ iex
Erlang R16B01 (erts-5.10.2) [source][/source] [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:false]
Interactive Elixir (0.10.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> IO.puts(“Woot”)
Woot
:ok
iex(2)>
Trying my hand at podcasting
May 22, 2013The closing stages of úll earlier this year featured two podcast recordings, live with the Unprofessional and The Talk Show guys. We were all in the audience, in the events room at Odessa, which happened to have a bar, and, well, we were all delighted, tired and emotional after a while, and in that fertile ground for promises and good ideas, the thought was thought - we should do this!
And, surprisingly, it happened, and you can subscribe to the first Verbose podcast. There's a twitter account @VerbosePodcast and an app.net account @VerbosePodcast for further firehosery.
The podcast itself is a rambling country garden of stuff, mostly themed around iOS and iOS development, but we pick up on other things too, like Google I/O and some of the nuisances of making software.
Yes, we will do better on the sound next time around! Sorry!