June 30, 2011

Fixing foursquare2 gem: NameError: uninitialized constant MultiJson

Filed under: Uncategorized — Tags: , , , — yasi8h @ 12:00 pm

If you get a error similar to the one bellow when you try to use (perform a simple task such as get a venue) from the foursquare2 gem. You are probably missing the multi_json gem.

NameError: uninitialized constant MultiJson
from /Users/jamesx/.rvm/gems/ruby-1.9.2-p180@snipwits3/gems/faraday_middleware-0.6.5/lib/faraday/response/parse_json.rb:16:in `parse’
from /Users/jamesx/.rvm/gems/ruby-1.9.2-p180@snipwits3/gems/faraday-0.6.1/lib/faraday/response.rb:17:in `on_complete’
from /Users/jamesx/.rvm/gems/ruby-1.9.2-p180@snipwits3/gems/faraday-0.6.1/lib/faraday/response.rb:9:in `block in call’
from /Users/jamesx/.rvm/gems/ruby-1.9.2-p180@snipwits3/gems/faraday-0.6.1/lib/faraday/response.rb:62:in `on_complete’
from /Users/jamesx/.rvm/gems/ruby-1.9.2-p180@snipwits3/gems/faraday-0.6.1/lib/faraday/response.rb:8:in `call’
from /Users/jamesx/.rvm/gems/ruby-1.9.2-p180@snipwits3/gems/faraday-0.6.1/lib/faraday/response.rb:8:in `call’
from /Users/jamesx/.rvm/gems/ruby-1.9.2-p180@snipwits3/gems/faraday-0.6.1/lib/faraday/adapter/net_http.rb:63:in `call’
from /Users/jamesx/.rvm/gems/ruby-1.9.2-p180@snipwits3/gems/faraday-0.6.1/lib/faraday/request.rb:88:in `run’
from /Users/jamesx/.rvm/gems/ruby-1.9.2-p180@snipwits3/gems/faraday-0.6.1/lib/faraday/request.rb:28:in `run’
from /Users/jamesx/.rvm/gems/ruby-1.9.2-p180@snipwits3/gems/faraday-0.6.1/lib/faraday/connection.rb:170:in `run_request’
from /Users/jamesx/.rvm/gems/ruby-1.9.2-p180@snipwits3/gems/faraday-0.6.1/lib/faraday/connection.rb:64:in `get’
from /Users/jamesx/.rvm/gems/ruby-1.9.2-p180@snipwits3/gems/foursquare2-1.1.0/lib/foursquare2/venues.rb:9:in `venue’
from (irb):6
from /Users/jamesx/.rvm/gems/ruby-1.9.2-p180@snipwits3/gems/railties-3.0.7/lib/rails/commands/console.rb:44:in `start’
from /Users/jamesx/.rvm/gems/ruby-1.9.2-p180@snipwits3/gems/railties-3.0.7/lib/rails/commands/console.rb:8:in `start’
from /Users/jamesx/.rvm/gems/ruby-1.9.2-p180@snipwits3/gems/railties-3.0.7/lib/rails/commands.rb:23:in `’
from script/rails:6:in `require’
from script/rails:6:in `’ruby-1.9.2-p180 :007 >

So to fix it, just add gem ‘multi_json’ to your Gemfile.


February 14, 2011

Fixing: /irb/completion.rb:9:in `require’: no such file to load — readline (LoadError) on rvm

Filed under: Uncategorized — Tags: , , , , , — yasi8h @ 10:25 am

Got this error to in one of the staging servers:

$ rails c production

/home/jooolaesa/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/irb/completion.rb:9:in `require’: no such file to load — readline (LoadError)
from /home/jooolaesa/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/irb/completion.rb:9:in `’
from /home/jooolaesa/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.0/lib/rails/commands/console.rb:3:in `require’
from /home/jooolaesa/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.0/lib/rails/commands/console.rb:3:in `’
from /home/jooolaesa/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.0/lib/rails/commands.rb:20:in `require’
from /home/jooolaesa/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.0/lib/rails/commands.rb:20:in `’
from script/rails:6:in `require’
from script/rails:6:in `’

It will appear if your ruby installation is not compiled with readline library. The solution is to recompile it with readline. If you are using RVM to manage your ruby installations you would go about doing it like this.

rvm package install readline

rvm remove 1.9.2 # note that 1.9.2 must be replaced with whatever ruby installation that you are going to recompile with readline support

rvm install 1.9.2 –with-readline-dir=$rvm_path/usr

Thats it!


September 29, 2010

fixing cannot open shared object file: Permission denied

Filed under: Uncategorized — Tags: , — yasi8h @ 1:22 am

Got this error when trying to start up apache. My config was as follows.

ruby 1.9
centos 5.3
rails 3

How i got around this is by switching off selinux on the system! Not ideal but it works.

look at on how to disable selinux on your system.

September 19, 2010

Notes from my First Rails 3 App

Filed under: Uncategorized — Tags: , , — yasi8h @ 12:52 pm

I just got stated with rails 3. Got in to some “not too hard to solve but takes a bit of a time to figure out a fix” type of issues. This post is a account of the problems and the solutions/work arounds i applied.

Notes on installing/using Mysql2

undefined method `errno’ for #Mysql2::Error:0x00000100ff0c98

On running rake db:create if you get a error such as:

undefined method `errno' for #Mysql2::Error:0x00000100ff0c98

this is a bug. Use the latest version of mysql2 adapter by adding this line to your Gemfile

gem 'mysql2', :git => ''

then it should be fine.


“Can’t connect to local MySQL server through socket ‘/opt/local/var/run/mysql5/mysqld.sock’ (2)”

If you get “Can’t connect to local MySQL server through socket ‘/opt/local/var/run/mysql5/mysqld.sock’ (2)” execute: locate mysql.sock and use the result in place of “socket: /Applications/MAMP/tmp/mysql/mysql.sock” which was where mysql.sock was located in my mac

socket: /Applications/MAMP/tmp/mysql/mysql.sock

Notes on installing Paperclip

make sure you have imagemagick installed

Notes on Using rails-ckeditor with rails3

If you get a error such as

NameError (uninitialized constant Ckeditor::Utils):

Then you need to patch rails-ckeditor


September 6, 2010

Fixing: ERROR: While executing gem … (Errno::ENOENT) No such file or directory

Filed under: Uncategorized — Tags: — yasi8h @ 7:03 am

This is a very specific (can occur with rvm, but i am not exactly sure what caused it) error that i encountered while trying to install rails + ruby 1.9.2 + rvm + OS X Snow Leopard. If you get a error like the following try creating a directory called cache inside your rvm gems folder. For me the error was occurring because i didn’t have a cache directory.


boxdundu:~ y8h$ gem install sqlite3-ruby
ERROR:  While executing gem … (Errno::ENOENT)
No such file or directory – /Users/y8h/.rvm/gems/ruby-1.9.2-p0@rails3/cache/sqlite3-ruby-1.3.1.gem
boxdundu:~ y8h$ gem install sqlite3-rubyERROR:  While executing gem … (Errno::ENOENT)    No such file or directory – /Users/y8h/.rvm/gems/ruby-1.9.2-p0@rails3/cache/sqlite3-ruby-1.3.1.gem


boxdundu:~ y8h$ mkdir .rvm/gems/cache

April 20, 2010

SqlCeException Unspecified error [ 655360 ]

Filed under: Uncategorized — Tags: , — yasi8h @ 12:44 pm

I spend a fair amount of time searching the net for this. All because i couldn’t notice the Native Error: 25101 in the exception.

SQL Server Compact has exceeded the buffer size. The default size can be increased on initialization by modifying the ssce: max buffer size property.


max buffer size
The largest amount of memory, in kilobytes, that SQL Server Mobile can use before it starts flushing changes to disk. If not specified, the default value is 640.

You can try increasing your buffer size.

conn.ConnectionString =
“Persist Security Info = False; Data Source = ‘SalesData.sdf’;” +
“Password = ‘
‘; File Mode = ‘shared read’; ” +
“Max Database Size = 256; Max Buffer Size = 1024”;

November 7, 2009

Installing uTorrent on Ubuntu – “It seems like utorrent is already running but not responding” Bug Fix/Workaround

Filed under: Uncategorized — Tags: , — yasi8h @ 10:20 am

I got the above mentioned error when i tried to install uTorrent 1.8.4 on Ubuntu Karmic Kola i386, though wine. But this error does not come if you try to install utorrent 1.8.2 or a older version. Hence i installed 1.8.2 and then updated it to 1.8.4 and it works fine. i think the latest versions have some bug in the installer part. installing a old version that doesn’t have this bug and upgrading seems to be a good work around. Note that if you installed 1.8.4 or something newer you will have to uninstall it from wine and then install 1.8.2. even then if you are getting the same error try killing wine and restarting it (wineboot should do the trick according to If that doesn’t work for you just kill the two processes that belong to wine and restart it).

January 18, 2007


Filed under: Uncategorized — Tags: , — yasi8h @ 1:09 pm

Oh well i got ADSL but it sucks!!! the connection is no where near 512kbps, well thats fine you can’t expect it to be so high even though they say its 512 because its ADSL 🙂 but the thing with my connection is it never goes above 70 or 90 kbps!!! and the dns server are not responding! and the connection goes down every five minutes!!! man that sucks! but anyways i called the SLT adsl people about this and that lady who spoke to me diverted me to a line where i reported a error with my phone line( yes i have a buggy slt phone line and the lady told me to check the phone line cause she thinks that the problem is with the phone line! ???).

So the next day(and thats today) the the phone company sent some people to fix the line. and they could not find the bugs first but then they found a broken(not fully broken… 🙂 wire! which was causing the problem. Now i hope that guy did not lied about that. he showed us the piece of wire(that he have fixed most probably).

Whatever the adsl connection has improved afterwards now i have less down time. And i am runing a dns server to speed up everything(apart from faster fox + firefox, Google web accelerator… :-).

Blog at