:layout => false
Thursday 11/27/2008 – Category: Merb
I ran into a strange behavior when trying to use setInterval in JS to make an AJAX request every n seconds. I had the timer in the $(document).ready(function() { } in the head of my application layout file.
There would be strange behavior with the timer–every interval would be twice as fast as the previous, and [...]
Merb rake tasks
Thursday 11/27/2008 – Category: Merb
When trying to run a merb rake task I wrote, I ran across this error:
rake aborted!
Don’t know how to build task ‘environment’
It turns out that merb uses a different environment variable than Rails, so instead of :environment use :merb_env instead:
task :whatever => :merb_env do
merb and Twitter made easy with Twitter4R
Wednesday 11/26/2008 – Category: Merb
Updating twitter with merb is super easy with Twitter4R:
sudo gem install twitter4r
in config/dependencies.rb:
gem “twitter4r”
require ‘twitter’
(just doing dependency “twitter4r” didn’t work)
in your controller:
client = Twitter::Client.new(:login => ‘username’, :password => ‘password’)
status = client.status(:post, “hello world”)
Strange errors when upgrading merb
Wednesday 11/26/2008 – Category: Merb
I had some strange errors when upgrading to the latest version of merb (1.1.3). When trying to run
rake db:automigrate
I would get something like:
~ Connecting to database…
/opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/data_objects_adapter.rb:137:in `initialize’: wrong number of arguments (8 for 1) (ArgumentError)
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/data_objects_adapter.rb:137:in `new’
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/data_objects_adapter.rb:137:in `normalize_uri’
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/abstract_adapter.rb:44:in `initialize’
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/data_objects_adapter.rb:159:in `initialize’
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core.rb:157:in `new’
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core.rb:157:in `setup’
from /opt/local/lib/ruby/gems/1.8/gems/merb_datamapper-1.0/lib/merb/orms/data_mapper/connection.rb:44:in `setup_connections’
from /opt/local/lib/ruby/gems/1.8/gems/merb_datamapper-1.0/lib/merb/orms/data_mapper/connection.rb:27:in `connect’
from /opt/local/lib/ruby/gems/1.8/gems/merb_datamapper-1.0/lib/merb_datamapper.rb:17:in `run’
from /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0/lib/merb-core/bootloader.rb:99:in `run’
from [...]
Recent Posts
- LED Light for iPhone 4
(Monday 06/28/2010 – 38 Comments) - WWDC 2010: Worth Every Minute
(Monday 06/14/2010 – No Comments) - Flickr Original for Safari 5!
(Wednesday 06/9/2010 – 15 Comments) - iPad thoughts
(Friday 04/2/2010 – 1 Comment)
