This used to be quite a complicated task to install ImageMagick and RMagick from source, but these days (thanks to some great work by others) it’s a piece of cake…
First install ImageMagick using this install script hosted on github (http://github.com/masterkain/ImageMagick-sl):
cd ~/src
git clone git://github.com/masterkain/ImageMagick-sl.git
cd ImageMagick-sl
chmod +x install_im.sh
sh install_im.sh
Now simply sit back and wait. (Oh, you’ll need to enter your password at some points as the libraries are installed into /usr/local).
Then, once that’s done, RMagick is installed by:
Simples.
This quick crib sheet is for the guys at work (and anyone else who might need help on this one)…
First install the oracle instant client somewhere - I normally install it to /usr/local/oracle/instantclient_10_2. Then…
cd /usr/local/oracle/instantclient_10_2
ln -s libclntsh.dylib.10.1 libclntsh.dylib
Following this, run mkdir -p /usr/local/oracle/network/admin/, and place a copy of the tnsnames.ora file in this directory.
Now you need to add the following to your .profile or .bashrc file:
# Oracle env variables
export ORACLE_HOME="/usr/local/oracle/instantclient_10_2"
export DYLD_LIBRARY_PATH="/usr/local/oracle/instantclient_10_2:$DYLD_LIBRARY_PATH"
export SQLPATH="/usr/local/oracle/instantclient_10_2"
export TNS_ADMIN="/usr/local/oracle/network/admin"
export NLS_LANG="AMERICAN_AMERICA.UTF8"
export PATH="$PATH:$DYLD_LIBRARY_PATH"
That’s all of the set-up done, now you just need to install the gem:
Done.
A lot of my work these days involves building and querying biomart datasets. Interacting with the webservices (for queries) is pretty simple, you just have to post a piece of xml at the right url, but I found myself reusing a lot of boilerplate code in each and every new script.
So, to make my life a little easier (and hopefully some others) I packaged all of the code up in a module with classes to handle all of the monkey work for me and decided to release it as a gem.
The source code is available from github, and the documentation is on rdoc.info.
For more details, check out the release anouncement.
It’s my first ruby module so any advice or pointers on how to make things better would be most appreciated.
Following on from my last post for getting PostgreSQL up and running nicely on Mac OS X, my next task was getting it playing nicely with ruby on rails - I’m off on a rails course next week so I’m getting stuff ready.
It appears that there is currently two/three gem packages for using postgresql with ruby: postgres, ruby-pg, and pg - and from what I can make out, they’re all maintained by the same team now, (postgres was the original package, but it got abandoned - ruby-pg and pg are the replacements). As such, i’ll go with the newer ruby-pg gem…
sudo env ARCHFLAGS="-arch i386" gem install \
ruby-pg -- \
--with-pgsql-lib=/opt/local/lib/postgresql83 \
--with-pgsql-include=/opt/local/include/postgresql83
Then finally, when writing the database.yml entry for connecting to postgresql, we have to define our adapter as follows:
development:
adapter: postgresql
database: test_dev
encoding: unicode
host: localhost
user: XXXXX
password: XXXXX
timeout: 5000
A great little command-line tool for Leopard:
osx-trash manipulates the Mac OS X trash from the command line, just like the Finder does. It uses AppleScript via Scripting Bridge on top of to communicate with the Finder. You can move files to the trash, empty the trash, and list items currently in the trash.
project page via
(1)
First in a series of three articles from Apple on Ruby on Rails development on Mac OS X Leopard. Definitely worth a bookmark.
Ruby on Rails is a popular and powerful open source web framework for rapidly creating high-quality web applications to help you keep up with the speed of the Web. Rails is thriving on Mac OS X, and Leopard comes pre-installed with Ruby, Rails, Mongrel, Capistrano, Subversion, and other tools that help to streamline the development and deployment of Rails applications. In addition, the Organizer feature of XCode 3.0 keeps your development workflow efficient.
This article gives you a full tour of Ruby on Rails 2.0 on Leopard—starting with building a web application using the latest Rails features with Xcode 3.0, and finishing with deploying the application to a production server running Leopard Server. Along the way we’ll explore unique features and benefits that Leopard brings to the party. In the end you’ll be better equipped to consider the advantages of powering your web application with Rails on Leopard.
This is the first in a series of three articles:
- This article on Development, where you learn to build a basic RESTful Rails application using Xcode 3.0;
- Customization, where we discuss working with views and web forms, adding AJAX support, and supporting an iPhone interface;
- Deployment, where we set up version control, write a Capistrano recipe, and deploy on Leopard Server.
Together they will give you a great start in working with Rails on Mac OS X Leopard.
full article
(2)
This could be most useful in the near future…
Most web applications have many more model objects exposed on the backend, or admin side, than they do on the front. Coding interfaces for all those models is redundant and a waste of resources when all you need is CRUD functionality that’s smart enough to handle all your ActiveRecord associations.
ActiveScaffold is a Ruby on Rails plugin that provides you with a wealth of dynamically created goodness, just plug the ActiveScaffold into your controller, you can have a AJAXified table interface for creating, updating, and deleting objects then. It has the following main features as well.
- Automatic handling of ActiveRecord associations
- Sorting, Search and Pagination
- Graceful JavaScript degradation
- RESTful API support (XML/YAML/JSON) baked in
- Sexy CSS styling and theming support

via
(0)
Recent Comments