June 30th, 2009 | Design & Development | No Comments »
I recently switched my Java versions from 1.5 to 1.6 and I’ve been hitting some issues with the java path.
I tried setting the environment variable JAVA_HOME=/usr and that worked for some stuff but I still saw this error when running java.
eg:
>java -version
Unable to find a $JAVA_HOME at “/usr”, continuing with system-provided Java
I solved the problem by doing the following.
First I found out where java actually was with:
>ls -l' `which java`
/usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
I noticed a command called java_home in that same directory. Running that command yields the correct java home directory.
>/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java_home
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
To correctly set the my JAVA_HOME environment variable in future, I added the following to my ~/.profile
export JAVA_HOME=`/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java_home`
Once you have done this you can restart your terminal window or run >. ~/.profile to reload you profile into the current terminal session.
April 29th, 2009 | Design & Development | No Comments »
It took me a little while to get passenger set up with Nginx because I wanted to compile Nginx separately instead of using the tool provided with the passenger gem. I have it all working now so here’s how I did it. I’m running OSX Leopard but this should be fine on any Linux distro too.
(more…)
February 5th, 2009 | Design & Development | No Comments »
I was setting up WP-Super-Cache yesterday when I ran into this gotcha, I’ve done this before so I should have known better, I’m blogging it now so that I don’t forget and anyone else with this issue can be saved some hassle.
Essentially WP-Super-Cache was only half on, it could generate wp-cache files but was not creating static cache files. The reason for this was that the querystring always contained at least one value even though it wasn’t in my URLs. That drove me crazy until I remembered this morning that the recommended Nginx setup was the problem the last time. The reason for this is the following part of the Nginx config that rewrites any non existing file requests to Wordpress’ index.php
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
}
This will cause WP-Super-Cache to never generate any static cache files since one of its conditions for doing so is that the querystring is empty.
If your Nginx config has this, try changing removing the ?q=$1 as below:
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php last;
}
December 23rd, 2008 | Uncategorized | 1 Comment »
My girlfriend won a PS3 at work yesterday. So yeah, Christmas came early for me! Before I started any gaming I wanted to see what the media centre capabilities were but I ran into some trouble with the wireless setup. Here’s what I did. This is not meant to be a beginners step by step guide but It will point you in the right direction if you run into this problem.
(more…)
December 22nd, 2008 | Uncategorized | No Comments »
I completed my move from GoDaddy to Slicehost over the weekend. My move to a grown up host was long overdue. I went with a 256mb slice to start with and Ubuntu 8.04. I have to say Slicehost are superb and I’d recommend them to anyone, my only problem, though it’s not their fault is that I do notice a small bit of latency when I’m issuing commands over ssh, but hey I’m almost on the other side of the world, what can you do?
I’m now running Wordpress 2.7 served up with Nginx and PHP over fast-cgi. I don’t get much traffic but if I ever do I’ll be able to handle it.
That’s all for now. Enjoy the Holidays.
December 4th, 2008 | Song Of The Week | No Comments »
So long since I’ve posted a song of the week. Laziness really, or maybe just lack of songs that I really felt good about. I never really gave Glen Hansard much attention until I watched Once. I can’t stop listening to him now. And this track ‘Say it to me now’ has gone straight into my all-time favourite songs.
September 15th, 2008 | Uncategorized | 1 Comment »
I was installing Rubygems 1.2.0 on Ubuntu 7.04 on Friday, something I’ve done many times but for the first time I saw this error when I ran sudo ruby setup.rb
./lib/rubygems/spec_fetcher.rb:1:in `require': no such file to load -- zlib (LoadError)
from ./lib/rubygems/spec_fetcher.rb:1
from ./lib/rubygems/source_index.rb:10:in `require'
from ./lib/rubygems/source_index.rb:10
from ./lib/rubygems.rb:767:in `require'
from ./lib/rubygems.rb:767
from setup.rb:22:in `require'
from setup.rb:22
Having a look around the web yielded several approaches to solve the problem but no solution so I decided to build Zlib from source, then rebuild Ruby and then install Rubygems. That worked.
(more…)
September 8th, 2008 | Uncategorized | No Comments »
Just a quick note on a problem I ran into this morning.
I needed the mysql gem so I ran gem install mysql only to find I got the following error:
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.
The solution was to use the following:
gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
It should work as long as the path to mysql_config is correct, you may need to change the path for your own system. You can check the path to mysql_config with: which mysql_config
August 25th, 2008 | Uncategorized | No Comments »
I've had a bit of trouble trying to disable active record in my rails app today. I set the following in environment.rb as I had done before in rails 2.0.2:
RUBY:
-
config.frameworks -= [ :active_record ]
However it resulted in the following error:
RUBY:
-
vendor/rails/activesupport/lib/active_support/dependencies.rb:278:in `load_missing_constant': uninitialized constant ActiveRecord (NameError)
The problem is that [your app]/config/initializers/new_rails_defaults.rb should check to see if ActiveRecord is enabled before it references it. A patch for this has already been checked into the rails codebase but if you don't want to wait for the next release you can get the patch from the link below and apply it yourself:
http://github.com/rails/rails/tree/4b4aa8f6e08ba2aa2ddce56f1d5b631a78eeef6c/railties/configs/initializers/new_rails_defaults.rb
Note:
I made the mistake of applying this patch directly to rails/railties/configs/initializers/new_rails_defaults.rb as the patch does and wondered then why the fix didn't work. It would work for any new rails apps that you create but you'll need to apply it to config/initializers/new_rails_defaults.rb in your rails app in order for this to work.
July 15th, 2008 | Uncategorized | 1 Comment »
I've finally got around to taking guitar lessons which I started about a month ago. The lessons have been giving me an even greater appreciation for finger-style playing. Actually if anyone is thinking about taking lessons I highly recommend my teacher, check out http://www.flyingfingers.ie for more information.
I stumbled across this great great YouTube find this morning and wanted to highlight it. I love The Police and 'Message in a Bottle' is one of my all-time favourite songs. This cover is just brilliant.