“Installing Juggernaut GEM - headache -painkiller”
Well one of our need was Juggernaut as we wanted to have a push server .
Well using was straight forward as mentioned in the below link:
http://juggernaut.rubyforge.org/
but installing juggernaut took a hell of the deed.
Follow the steps :
1/ gem install json
2/gem install json_pure
3/gem install eventmachine
4/gem install juggernaut –ignore-dependencies
not installing “json_pure” wont make the juggernaut install
I hope its useful for you.
Even after this when you say juggernaut -g juggernaut.yml on your command prompt then it will throw you an exception saying json version error need v=1.1.2 , So to rectify this .
Trace down to “\ruby\lib\ruby\gems\1.8\specifications\juggernaut-0.5.4.gemspec“
and change the
s.add_dependency(%q eventmachine, [">= 0.10.0"])
s.add_dependency(%q json, [">= 1.1.2"]) # —- changed this to 1.1.1
s.add_dependency(%q hoe, [">= 1.5.1"]) #— changed this to 1.3.1
Then start juggernaut. juggernaut -c juggernaut.yml
PS :: Reference I took
http://www.google.co.in/search?q=can’t+install+juggernaut+gem&sourceid=navclient-ff&ie=UTF-8&rlz=1B3GGGL_enIN274IN274
top 4 links.
Add comment August 26, 2008
“The Twitter Song: You’re No One If You’re Not On Twitter”
You’re no one if you’re not on Twitter; And if you aren’t there already you’ve missed it. If you haven’t been bookmarked, retweeted and blogged; You might as well not have existed.
Here is the awesome Twitter song from Ben Walker.
If you enjoy this, you might like to watch The Rise and Fall of Twitter.
You’re No One If You’re Not On Twitter (Lyric)
You’re no one if you’re not on Twitter
And if you aren’t there already you’ve missed it
If you haven’t been bookmarked, retweeted and blogged
You might as well not have existed
In the old days it was all about achievements
Collecting all your trophies in a shrine
Then everybody came across the internet
And suddenly you had to be online
A home page was all you really needed
To seem like a success but not a geek
As long as you updated semi-annually
And checked your email once or twice a week
You’re no one if you’re not on Twitter…
Technology was moving rather quickly
And the next thing you needed was a blog
With intimate and detailed press releases
And now and then a photo of your dog
More recently the students brought us Facebook
And everybody has a hundred friends
The parties in the photos look amazing
They’re not so great but everyone pretends
You’re no one if you’re not on Twitter…
Now you need to publish every movement
And every single thought to cross your mind
I’m told the Twitterverse is full of rubbish
But most of us are actually quite refined
We validate each other’s insecurities
And brag about the gadgets that we’ve bought
We laugh out loud at every hint of jolliness
And try to self-promote without being caught
You’re no one if you’re not on Twitter…
Add comment August 26, 2008
“Back Button issue solved “
We could have used redirect_to :back , BUT that in-turn calls (request.env["HTTP_REFERER"]) , hence what I would have done is called a action and through the action said redirect_to :back , hence the HTTP_REFERER would have redirected to the same action once again,which was like refreshing the page .
Hence to skip one page , we went into the source code got the code and said the same in the link itself.
Add comment August 13, 2008
“Active scafffold on rails 2.+”
Active scaffold which was a big hit for the admin related sites was proven not helpful on the newer version of rails.
I got hold of a very good patch of Active Scaffold which works on Rails v2.+ .
All you need to do is remove the older plugin and replace all the files with the patched version..
SO , heres the link …
http://github.com/jfernandez/activescaffold/tree/master
FYR you can also check ,
http://groups.google.com/group/activescaffold/browse_thread/thread/206b0bf266b3ba5b#
Technorati Tags: rails, ruby on rails, active_scaffold, active scaffold on rails 2.+
Add comment July 31, 2008
“Railties changes”
Default database is now SQLite3: The default database is now SQLite3 instead of MySQL. Running ‘rails takeover_the_world_app’ will now come with a database.yml that’s setup for SQLite3. To get the old behavior (where it’s preconfigured for
MySQL), run rails -d mysql takeover_the_world_app instead. This is mostly to make this “just work” on Mac OS X Leopard, where SQLite3 is already installed with the OS.
Template loading is faster: DHH has turned on ActionView::Base.cache_template_loading by default in the production.rb
environment config file that basically means that Rails no longer does
file system stat calls when loading templates. The downside is that you
have to restart your Rails application to see templates changes in
production mode, but it’s not really that big an issue since no one
should be editing templates anyway ‘live’ in a production application.
New rake tasks for migrations: rake db:migrate:redo to undo your last migration and re-run it - very useful when developing migrations (when you screw up, that is). rake db:migrate:reset drops the database, re-creates it, and then runs all migrations.
rake task for generating secret keys: rake secret
to generate a secure key that you can use for cookie sessions. This is
useful for updating Rails applications from 1.x to 2.x, which uses
cookie-based sessions by default and requires a secret key.
config.action_controller.session = {
:session_key => ‘_your_app_session’,
:secret => ’some super long string that you can generate with the rake secret task’
}
Personally I just use super long quotes from Family Guy.
That’s it! For the curious, expect Ruby 1.9 compatibility, improved
caching, and big ActionPack and rendering refactoring changes in Rails
2.1.
Technorati Tags: rails, ruby on rails, Railties changes, migrations
Add comment July 31, 2008
“Side effects of beer”
1. Symptom: Cold and humid feet.
Cause: Glass is being held at incorrect angle
(You are pouring the Drink on your feet).
Cure: Maneuver glass until open end is facing upward
2. Symptom : The wall facing you is full of lights.
Cause : You’re lying on the floor.
Cure: Position your body at a 90-degree angle to the floor.
3. Symptom: The floor looks blurry.
Cause : You’re looking through an empty glass.
Cure: Quickly refill with your favorite drink!
4. Symptom : The floor is moving.
Cause: You’re being dragged away.
Cure: At least ask where they’re taking you!
5. Symptom : You hear echoes every time someone speaks.
Cause : You have your glass on your ear.
Cure: Stop making a fool of yourself!
6. Symptom: Your dad and all your brothers are looking funny.
Cause: You’re in the wrong house.
Cure: Ask if they can point you to your house.
7 . Symptom: The room is shaking a lot, everyone is dressed in white and
The music is very repetitive.
Cause : You’re in an ambulance.
Cure: Don’t move. Let the professionals do their job
Cheers all !
Technorati Tags: Side effects of beer, others
Add comment July 25, 2008
“Proc.new vs Lambda in Ruby”
I found the following lines of code on Wikipedia today. It’s a very succinct description of one important difference between a lambda and a Proc. Try printing the return value of f.call for more insight.
def foo
f = Proc.new { return “return from foo from inside proc” }
f.call # control leaves foo here
return “return from foo”
end
def bar
f = lambda { return “return from lambda” }
f.call # control does not leave bar here
return “return from bar”
end
puts foo # prints “return from foo from inside proc”
puts bar # prints “return from bar”
Technorati Tags: ROR, ruby on rails, Proc.new vs Lambda in Ruby
Add comment July 23, 2008
“Bulk insertion of data with ActiveRecord”
Was just going through some blogs doing RnD here and there when I stumbled upon a blog at http://rubypond.com , felt awesome and hence thought of sharing with everyone.
have Cpt then entire post I hope its useful enough.
Its about pushing bulk insertions into the database using active records.
there are various ways , one is loop it the other is as follows which to me seems pretty cool.
Zach Dennis has written a great little plugin called ActiveRecord::Extensions which makes the bulk inserts almost as painless as your regular create.
First, install the gem:
sudo gem install ar-extensions
Include it in your app (you could put it in environment.rb if you’re going to use it a lot, for now I’ll place it in my model definition in user.rb:
require ‘ar-extensions’
class User
end
Then to use it, it really couldn’t be more straightforward. Use the following in your controller or rake task to import your data:
fields = [:first_name, :last_name, :email]
data = [["glenn", "gillen", "foo@bar.com"],
["john", "jones", "jim@bar.com"],
["steve", "smith", "bar@foo.com"]]User.import fields, data
And we’re done, 3 new rows have been inserted into the users table, with just the single query. Any more questions, the RDocs are here
Chao!!!!!!!
Technorati Tags: ROR, ruby on rails, Active record, Bulk insertion of data with ActiveRecord
Add comment July 23, 2008
“Is ROR hot ? Yes maybe ,with new PORN sites emerging on ROR”
I dont have anything to say ,cumon its a Porn site you on ROR see it to believe it .
I dont know whether its legal or not , but the disclaimer says it is.
Heres the link! http://dominr.com .Watch out for your SYs Admin.
Technorati Tags: ROR, ruby on rails, Porn sites on ruby on rails
Add comment July 23, 2008
