Thursday, July 8, 2010

Changing your gem environment

Look for a file called .gemrc in your home directory - remember it's a hidden file, so might not be immediately visible. 

Edit it in the normal way, so, if you want a proxy type in: 
http_proxy: http://px1.org.uk:8080
one the second line.

Bob's your uncle.


Friday, March 26, 2010

Using gems from the command line behind a proxy

Before running the gem commands:
export HTTP_PROXY=http://proxy_url:proxy_port

simples

Friday, February 12, 2010

How to get gems running from behind proxy: e.g. heroku

First, type in the following in the command line
export HTTP_PROXY='http://proxy.com:8080'
Then any gems you use from there will work via your proxy.
I used this to get the heroku gem running

Monday, December 14, 2009

Creating a Date object in Ruby from a date

How to get a Date object
Date.new(2009,12,22)

How to format a Date objecct
Date.new(2009,12,22).to_formatted_s(:short)
gives 24 oct

Monday, December 1, 2008

How to lock down a computer

For Windows XP.
  • Create limited user account.
  • From admin open gpedit.msc
  • Go to Administrative Templates > System > Run only allowed Windows Applications
  • Define applications as winword.exe, firefox.exe etc.
  • Don't forget whatever you do to include gpedit.msc and mmc.exe otherwise you won't be able to get back in! 
  • Get rid of run... command.

Monday, November 10, 2008

/!\ FAILSAFE /!\ Status: 500 Internal Server Error wrong number of arguments (1 for 0)

/!\ FAILSAFE /!\ Status: 500 Internal Server Error wrong number of arguments (1 for 0)


Problem:
You probably added a method called Send which is causing this error to be thrown.


Rename your method to something other than 'Send'.

http://flexrails.blogspot.com/2008/04/failsafe-mystereous-error-message.html

Saturday, November 8, 2008

installing ruby 1.8.7 on rimuhosting stack

A new installation will automatically install in /usr/local/   whilst your symbolic links are pointing to the installation in /usr/. The initial installation will therefoer not update your ruby version, unless you specify it everytime.

In order to make ruby 1.8.7 the default the symbolic links for ruby/gem/irb/erb/rake  all need to be updated. Then all gems will need to be reinstalled, and indeed the passenger configuration in apache will need to be updated.