PullMonkey Blog

19 May

Ubuntu – The disk drive for X is not ready yet or not present

After an Ubuntu install go wrong my laptop started coming up with this error message:
The disk drive for X is not ready yet or not present
In my case, the laptop was having trouble with /dev/sda1, my root partition.
The Solution:
The error message above is met with two solutions, press S to skip or M to do a manual install. Press "M" for manual install.
Once you are the command prompt, your drive will have been mounted as read-only, change that like this:

mount /dev/sda1 -o rw,remount

Now that the drive is in read-write again (test with a simple touch /tmp/test), continue the installation with this:

dpkg --configure -a

30 Apr

Spreadsheet Gem – data may have been lost

I've been using the spreadsheet gem lately for a couple projects I am working on to modify existing spreadsheets. I have quite often stumbled upon this error when opening modified spreadsheets in excel:

File error: data may have been lost

Like most microsoft errors, it was useless and the spreadsheet came up just fine. But that error was just so annoying, other spreadsheet applications (open office, excel on mac) opened without any problems. So after quite a bit of hacking and digging around, I finally tried setting the encoding, which defaults to UTF-8. Well it just so happens that the spreadsheet being modified was encoded with UTF-16LE.

So part one of my solution became this:


Spreadsheet.client_encoding = 'UTF-16LE'

Then doing a little more digging I decided that this would be a better long-term solution:


book = Spreadsheet.open spreadsheet_file
Spreadsheet.client_encoding = book.encoding

Well, hopefully it wasn't just me and someone will be able to save a bit of time with this.

10 Mar

Compilation failed: this version of PCRE is not compiled with PCRE_UTF8 support

I don't do too much with php these days, and really haven't since I found rails many years ago. But I figured I would give magento a try, just for fun. Most of it worked, but I continually came across this PCRE error - the full error that I go was:

Warning: preg_match_all() [function.preg-match-all]: Compilation failed: this version of PCRE is not compiled with PCRE_UTF8 support at offset 0  ...

Ok, loads and loads of research led no where, or at least no where that I was willing to go. I tried so hard to find a solution that didn't require me recompiling apache ... well no such luck. I am using slicehost's ubuntu 8.04, so I took the dpkg approach to help make things simple.

Well, I am sure you have found out by now that apache comes with its own version of pcre built in (version 5). This version does not come with UTF-8 support. The trick is to tell apache to use an external system package of pcre. This requires the slightest bit of reconfiguring of apache.
Initially, my pcre looked like this (notice the version of 5.0...):

As mentioned earlier this is a pretty good indicator that your pcre is the built-in apache version. This is not good.

Ok, the solution is not too bad. Compared to this article, which I learned a few things from, it is much simpler. One thing, you will note in the article is the use of --with-pcre=/usr - this is quite different than the --with-pcre=yes that apache2 comes configured with from gusty.
So the solution is to make that change by doing this:
1) Get the source code:

mkdir apache_src
cd apache_src/
apt-get source apache2

2) Modify the configuration (specifically the AP2_COMMON_CONFARGS in debian/rules)
Once the source is downloaded you should have several files and a directory. Edit the debian/rules files from within the apache directory. The only change that is needed is to find the line that says --with-pcre=yes and change it to say --with-pcre=/usr.
This, of course, assumes that you installed pcre and it lives in /usr/(bin,lib ...):

vi apache2-2.2.4/debian/rules # make those changes

3) Install build dependencies for apache:

sudo apt-get build-dep apache2

4) Now build the package:

cd apache2-2.2.4/
# you may need to install fakeroot for this:
sudo apt-get install fakeroot 
dpkg-buildpackage -rfakeroot -uc -b

5) Install the new apache package:

cd ..
sudo dpkg -i apache2_2.2.4-3ubuntu0.1_all.deb

Voila, now look what I have:

That should be it.

Good luck.