Error with passenger-install-nginx-module – Could not find RubyGem passenger (>= 0) (Gem::LoadError)

If you are troubled with

passenger-install-nginx-module /home/web90seconds/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:900:in `report_activate_error’: Could not find RubyGem passenger (>= 0) (Gem::LoadError)

Then try

sudo env GEM_HOME=$GEM_HOME /home/me/.rvm/gems/ruby-1.9.2-p180/bin/passenger-install-nginx-module

Obviously change the location of your passenger-install-nginx-module binary.

Posted on March 28, 2011 at 12:53 pm by Jordan Carter · Permalink · 2 Comments
In: Ruby on Rails, Server Config · Tagged with: , ,

Gem Install Error – no such file to load — zlib

If you are troubled with the below

gem install
ERROR: Loading command: install (LoadError)
no such file to load — zlib
ERROR: While executing gem … (NameError)
uninitialized constant Gem::Commands::InstallCommand

Then you have installed ruby without the nessacary libraries available.

Remove the ruby install (hopefully just rvm remove 1.9.2)
Then install zlib1g-dev libssl-dev libreadline5-dev as detailed at the start of this post on installing ruby on rails on Ubuntu

Now install ruby again and try again!

Hope this helps

Posted on March 28, 2011 at 12:41 pm by Jordan Carter · Permalink · 2 Comments
In: Ruby on Rails, Server Config · Tagged with: 

Arduino controlling LED Bar – Patterns and Bouncing

So it finally arrived!  After only 20 hours, thanks to www.nicegear.co.nz for the awesome quick ship.

I made a video of my Arduino Mega 2560 in action and will post the code below.

Arduino source code after the break Read the rest of this post »

Posted on March 9, 2011 at 10:27 pm by Jordan Carter · Permalink · Leave a comment
In: Arduino, How To, Video · Tagged with: ,

Arduino

Time to get into the exploding world of arduino.

I have just ordered my kit from www.nicegear.co.nz.  Haven’t dealt with these guys before but have emailed back and forth and they are very responsive and interested.  Good start!

I intend to convert my incapable T-Rex 450 Pro (only because I the pilot am incapable) into a mission ready UAV. They guys over at DIYDrones are busy at work getting their open source UAV projects flying high.  Some amazing progress going on over there with QuadCopters and Hexacopters, even some Octocopters.

None of which are aimed at the Collective Pitch standard RC heli.  Well there is ArduCopter_TradHeli running ArduCopterNG code which is due for release very soon!

Until then I am going to play around with some Arduino projects, a little breathalyzer and a range finder, separate projects… of course.  Should have some fun, aka frustration getting the LCD screen cranking.  I have looked at the source code, wow.  That is going to keep me up late.

There is also the RAD project, Ruby Arduino Development, which lets you write Ruby code then compile it onto the Arduino platform.  Sounds like fun but I might learn a little Arduino code first, so that I can get my head into it and debug it a little.  Has been a while since I learnt a new language, though it is very similar to Processing, which is similar to ActionScript :)

Posted on March 7, 2011 at 10:19 pm by Jordan Carter · Permalink · Leave a comment
In: Arduino, Artifical Intelligence · Tagged with: 

Compiling Firefox with jssh Support on Ubuntu

sudo apt-get build-dep firefox
sudo apt-get install mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libxt-dev libiw-dev libglu1-mesa-dev

hg clone http://hg.mozilla.org/releases/mozilla-1.9.2/ 192src

#wait 10 minutes
cd mozilla-central
gedit .mozconfig

mk_add_options MOZ_CO_PROJECT=browser
mk_add_options [email protected]@/firefox-jssh
ac_add_options –enable-extensions=default,jssh
ac_add_options –enable-webservices
ac_add_options –enable-application=browser

autoconf2.13

cd js/src

autoconf2.13

cd ../..
make -f client.mk build
[sudo apt-get install yasm]

[possible errors]
/mozilla-central/config/rules.mk:1877: *** .js component without matching .manifest
make[4]: *** [jssh_export] Error 2
make[4]: Leaving directory `/home/jordan/Documents/hg/mozilla-central/firefox-jssh/extensions’
make[3]: *** [export_tier_app] Error 2
make[3]: Leaving directory `/home/jordan/Documents/hg/mozilla-central/firefox-jssh’
make[2]: *** [tier_app] Error 2
make[2]: Leaving directory `/home/jordan/Documents/hg/mozilla-central/firefox-jssh’
make[1]: *** [default] Error 2
make[1]: Leaving directory `/home/jordan/Documents/hg/mozilla-central/firefox-jssh’
make: *** [build] Error 2

I got around those errors by using “hg clone http://hg.mozilla.org/releases/mozilla-1.9.2/ 192src” and not mozilla-central.
[/]

./firefox-jssh/dist/bin/firefox -jssh

telnet localhost:9997

Posted on March 3, 2011 at 8:13 am by Jordan Carter · Permalink · Leave a comment
In: Ubuntu Tricks, Uncategorized · Tagged with: , ,

Rails or Ruby Memcached Gem on Ubuntu and Linux

Get the following error when trying to install memcached ruby gem on your Ubuntu or Linux box?

rlibmemcached_wrap.c: In function ‘_wrap_memcached_get_sasl_callbacks’:
rlibmemcached_wrap.c:12413: error: ‘sasl_callback_t’ undeclared (first use in this function)
rlibmemcached_wrap.c:12413: error: ‘result’ undeclared (first use in this function)
rlibmemcached_wrap.c:12424: error: expected expression before ‘)’ token
rlibmemcached_wrap.c: In function ‘Init_rlibmemcached’:
rlibmemcached_wrap.c:13694: error: ‘SASL_OK’ undeclared (first use in this function)
make: *** [rlibmemcached_wrap.o] Error 1

Gem files will remain installed in /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/memcached-1 for inspection.
Results logged to /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/memcached-1/ext/gem_make.out

Quick fix

sudo apt-get install libsasl2-dev libsasl2-dev

Then delete the gem folder with the current memcached stuff in it, for me that is

sudo rm -rf /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/memcached-1

THEN

sudo gem install memcached
Posted on October 13, 2010 at 9:26 am by Jordan Carter · Permalink · 2 Comments
In: Ruby on Rails, Server Config, Ubuntu Tricks · Tagged with: , ,

Fun HTML5 & Javascript Game – Infection

http://www.mattpelham.com/infection/ Is an entertaining HTML5 game, nice work!  Now make it multi-player :)

Posted on September 14, 2010 at 8:52 pm by Jordan Carter · Permalink · One Comment
In: Gaming, Web Development · Tagged with: 

How To – Persist Rails or IRB Console Command History After Exit

Sick of not having Ubuntu rails or irb terminal not saving your command history after exiting the console?  Try this little trick to fix it up!

Append into your ~/.irbrc the following Read the rest of this post »

Posted on September 14, 2010 at 11:46 am by Jordan Carter · Permalink · 3 Comments
In: How To, Ruby on Rails, Ubuntu Tricks · Tagged with: , , ,