Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Thursday, August 13, 2009

Setting Up the Palm Mojo SDK on 64-Bit Ubuntu 9.04

I'll probably be buying a new Palm Pre next month. As such, I've been tinkering with webOS, Palm's new Linux-powered mobile platform, the Palm Pre emulator, built on VirtualBox, and Palm's Mojo SDK. The Mojo SDK lets developers create Palm apps using ubiquitous web technologies (HTML, CSS, JavaScript) so it's an attractive choice for web developers looking to get into mobile development.

Here's what I had to do to get everything working on 64-bit Ubuntu 9.04.

First, the Palm Pre emulator requires VirtualBox 2.2+. If you're already running version 1.x, included in the Ubuntu repos, uninstall it.
$ sudo apt-get remove virtualbox
Download and install the latest 64-bit version of VirtualBox from virtualbox.org. I found a debian package for version 3.0 here.

If you're upgrading from VirtualBox 1.x, you'll need to convert your settings.
$ VirtualBox --convertSettings
Next, you'll need to download and install the mojo and novacom packages as noted in Palm's setup instructions.

But wait, what's this? There are only 32-bit packages available! What should we do? Luckily, someone has already run into the problem. Read this excellent post from the "Tried It" blog here, and apply the author's script to both the mojo and novacom packages. At that point, they'll install successfully.

Now, you can finish following Palm's installation instructions. It's time to start buildin' apps!

Tuesday, July 28, 2009

Rails/Postgres Setup Gotchas - Ubuntu 9.04

I recently switched to Ubuntu 9.04 after using OpenSUSE- and Fedora-Based development environments for several years, and it's been great for both Rails development and general use. The defaults are well-chosen, hardware integration is seamless, and in general, the user experience is the best I've seen of any Linux distro. Still, the default Ubuntu install is missing many important development packages; I had to take a few unexpected steps to get a simple, Postgres-backed Rails project running under Ruby 1.8. Hopefully, documenting these steps will save time for other developers.


First, install basic ruby and rubygems packages:

$ sudo apt-get install ruby ruby-dev rubygems

If your app needs to make requests over SSL, i
nstall Ruby OpenSSL bindings:
$ sudo apt-get install libopenssl-ruby

SET UP POSTGRES AND DATABASES:
Install basic postgres packages. Note that some applications won't require postgresql-contrib:
$ sudo apt-get install postgresql postgresql-8.3 postgresql-8.3-plr
postgresql-client-8.3 postgresql-client-common postgresql-common
postgresql-contrib postgresql-contrib-8.3 postgresql-server-dev-8.3

Install the postgres gem (tested w/ version 0.7.9.2008.01.28)
$ sudo gem install postgres

Initialize postgres. As your system's postgres user:
$ initdb -D /var/lib/pgsql/data
$ pg_ctl -D /var/lib/pgsql/data -l logfile start

Make sure postgres starts on boot. In Ubuntu, this should be done automatically for you, but just to be sure:
$ sudo update-rc.d postgresql-8.3 defaults
# System startup links for /etc/init.d/postgresql-8.3 already exist

As the postgres user, create a user for psql; answering no to all questions. This will probably be the user referenced in your database.yml config file.
$ createuser dbuser

In order to give the user privilages to run DROP DATABASE for commands like
rake:test, you may have to do the following in psql:
ALTER USER dbuser CREATEUSER;