+45 70 27 40 08

sales@meeho.net

— Archive for the ‘Tech stuff’ category:

» PostgreSQL – ERROR: cannot drop the currently open database

Posted by Kasper Tidemann on Wednesday 17th of March 2010 10:35:06 PM

You might come across the following error when trying to drop a database in your PostgreSQL:

ERROR: cannot drop the currently open database

This is because you are trying to delete the database that you are currently connected to (or in MySQL jargon: the database you are current USEing). To fix the problem, try to issue the following command:

\connect postgres

This will connect you to the postgres database in PostgreSQL, sometimes referred to as the maintenance database. From here, try to issue your drop command again – it will now work out for you as expected.

0

Comment on this post

» scp – copy a file via SSH from a remote server to your computer

Posted by Kasper Tidemann on Wednesday 17th of March 2010 09:13:50 AM

If you have SSH access to a UNIX/Linux based system somewhere and want to copy a file located on the server to your computer via SSH, you can use the scp command found in most UNIX/Linux systems, including Mac OS X.

Say you want to copy a file from the remote server to your own computer, a file called my_file.txt. In this case, you would issue the following command in your terminal:

scp your_login@addres.of.remote.server:my_file.txt .

This makes your computer connect to the server with the login you provide, and copy the my_file.txt file to the directory you are currently working (using the exact same file name locally on your computer, that’s why there is a dot in the end of the command).

0

Comment on this post

» RubyGems: uninitialized constant Gem::GemRunner (NameError)

Posted by Kasper Tidemann on Saturday 6th of March 2010 10:59:44 PM

After having finished an update of your RubyGems installation, you might receive the following error:

uninitialized constant Gem::GemRunner (NameError)

If you get the above when trying to use gem, first of all, you need to find out which gem you’re using. Open up your shell and type in the following:

which gem

This will print out which gem you’re using and the location of it, typically being /usr/bin/gem or /usr/local/bin/gem.

Next, open up the actual gem file in your favourite text editor. If you’re using TextMate for Mac OS X, this can be accomplished directly from your shell by issuing the mate /usr/bin/gem command (you might need to change the path to gem to reflect your system setup).

Here, you’ll see a line reading require ‘rubygems’. Just below this line, add require ‘rubygems/gem_runner’, save the file and try to use gem again. It should work fine now. The change you need to do is shown below:

This showns the gem file brought up in TextMate. Line 10 is the fix.

This showns the gem file brought up in TextMate. Line 10 is the fix.

0

Comment on this post

» Problem with importing vCards containing foreign characters in Address Book for Mac OS X

Posted by Kasper Tidemann on Friday 26th of February 2010 06:17:46 PM

If you ever experience a problem with importing vCards (.vcf files) that contain foreign characters in Address Book for Mac OS X, you might be in complete dark as to how to solve the problem with the foreign characters not being displayed properly.

You might have tried to save the vCard as ISO-8859-1, UTF-8 or the likes, and it still doesn’t work in Address Book. You might even have tried to add charset info in the MIME type of the vCard, having it display something like text/vcard; charset=iso-8859-1 all the while it still doesn’t work. Bugger.

The only solution is to make Address Book use a different character encoding for the vCards. If you access Address Book -> Settings… -> vCard, you’ll see the ability to change the character encoding. However, Address Book might have chosen vCard version 3.0 for you per default. Change this to 2.1, then change the character set to e.g. Windows Latin 1, and then change the version back to version 3.0.

Having done the above, the import of vCards containing foreign characters will work as expected. This includes vCards exported from Meeho!™.

A screenshot of the settings regarding vCards in Address Book.

A screenshot of the settings regarding vCards in Address Book.

(One last note: Having to choose vCard version 2.1 to change the character encoding, then changing the version back to 3.0 AND having Address Book preserve the encoding settings might be a bug… Seems odd that it preserves the encoding settings while jumping from version 2.1 to version 3.0, when the dropdown menu is dimmed when set to vCard version 3.0, indicating that a change is not possible in that case…)

0

Comment on this post

 
OLDER POSTS
NEWER POSTS

+45 70 27 40 08
Open office hours

info@meeho.net

support@meeho.net

News from the Meeho!™ Blog:

02/14 2011 » Fixing the "NoMethodError: undefined method ‘to_sym' for false:FalseClass" error when working with I18n in Ruby on Rails

02/03 2011 » Soon to come: IMAP integration

01/27 2011 » Meeho!™ App version 1.0.3 is out!

01/26 2011 » Cool new iPad stand

We live at Diplomvej 381, 2800 Kgs. Lyngby, Denmark: