Digital Sanctum

software development, technology and other square topics

Archive for the ‘Ruby’ Category

MySQL Gem on Leopard

without comments

If you’re running the Leopard Mac OS, you’ll need the following command to properly install the MySQL gem:

sudo env ARCHFLAGS="-arch i386" gem install mysql -- \
   --with-mysql-config=/usr/local/mysql/bin/mysql_config

This page also has some good information that tries to answer questions regarding Ruby and OS X.

Written by Shane

December 5th, 2007 at 8:10 am

Posted in Ruby

Updating Ruby Gems in Leopard

without comments

This may be old news but I think little tidbits like this are important to document. If you’re running Ruby on Leopard (Mac OS) and you’re running into issues with your gems, try the following:

For intel-based macs:

sudo su
[Enter your password]
bash
export ARCHFLAGS=”-arch i386″
gem update

For ppc macs:

sudo su
[Enter your password]
bash
export ARCHFLAGS=”-arch ppc”
gem update

Written by Shane

December 5th, 2007 at 7:49 am

Posted in Ruby

How to Install Ruby on Rails 2.0

without comments

If you want to start playing with the latest features of Ruby on Rails (2.0 due out very soon), you can install from source with something like the following:

sudo gem install rails --source http://gems.rubyonrails.org -y

To verify your install,

rails --version

Written by Shane

November 10th, 2007 at 9:22 am

Uninstalling nginx via apt-get: Stopping nginx: invoke-rc.d: initscript nginx, action “stop” failed.

with 4 comments

If you get something like the following error:

CODE:
  1. Removing nginx ...
  2. Stopping nginx: nginx.
  3. Stopping nginx: invoke-rc.d: initscript nginx, action "stop" failed.
  4. dpkg: error processing nginx (--remove):
  5.  subprocess pre-removal script returned error exit status 1
  6. Starting nginx: /usr/sbin/nginx: error while loading shared libraries: libpcre.so.3: cannot open shared object file: No such file or directory
  7. invoke-rc.d: initscript nginx, action "start" failed.
  8. dpkg: error while cleaning up:
  9.  subprocess post-installation script returned error exit status 127
  10. Errors were encountered while processing:
  11.  nginx
  12. E: Sub-process /usr/bin/dpkg returned an error code (1)

when you try to execute something like this:

CODE:
  1. sudo apt-get remove nginx -yf

Then you need to add

exit 0

to the second line of your

/etc/init.d/nginx

file. Pure hackery but it works.

Written by Shane

November 7th, 2007 at 9:05 pm

Posted in Ruby, Ubuntu

Installing Mongrel on Ubuntu ERROR: While executing gem … (OpenURI::HTTPError)

without comments

If you get the following error:

ERROR: While executing gem ... (OpenURI::HTTPError)
404 Not Found

when running the following:

sudo gem install mongrel

Then run it again. Sometimes it takes running the command several times for it to take.

Written by Shane

November 7th, 2007 at 7:27 pm