install pg with native extension error

I was getting trouble to install pg gem. The error i was getting is

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

I also found some tips on SO. It was to locate the postgre’s config (pg_config) to bundler before running `bundle install` command. For general postgresql installation,

bundle config build.pg --with-pg-config=/usr/pgsql-9.1/bin/pg_config

(path was not same for me on Mac OSx. It was /Library/PostgreSQL/9.1/bin/pg_config)

But this did not solve my problem. I was still getting the same error when i was running bundler. However, when i tried to install the gem separately with this directive set, it worked fine.

gem install pg -- --with-pg-config=/Library/PostgreSQL/9.1/bin/pg_config

Now the gem is installed fine and i ran the `bundle install` and it was installed without issues.

Try it!

Read/Write on Mac OSx partition from Ubuntu

After dual booting with Ubuntu and Mac OS, I could not write on Mac OS partition. However, I must have to find a way to do that as I will move certain things to ext3 partitions to be seamlessly usable by Ubuntu.

While reading online, somewhere I have read that I will need to disable journaling in Mac OS partition to mount it on Ubuntu with writing permission. I wanted to do the same but I saw the Enable/Disable Journaling button is not enabled in Disk Utility. So, after searching I found a command to do that from command line. It is simple.

# diskutil disableJournal /Volumes/Macintosh HD

That’s it. It disabled journaling on that partition. Later on Ubuntu I mounted the drive and I could write on it.

More Info:

Mounting the partition on Ubuntu

sudo mount -t hfsplus /dev/sda2 /media/mac