Can't get ajaxful-rating-jquery to work with rails 3
I'm trying to use the rails3 branch of ajaxful_rating_jquery but I can't get past bundle install
. This is my Gemfile:
gem 'ajaxful_rating_jquery', :git => "git://github.com/kamui/ajaxfu开发者_C百科l_rating_jquery.git", :branch => 'rails3'
but bundle install
gives me this error:
Fetching source index for http://rubygems.org/
Could not find gem 'ajaxful_rating_jquery (>= 0)' in
git://github.com/kamui/ajaxful_rating_jquery.git (at rails3).
Source does not contain any versions of 'ajaxful_rating_jquery (>= 0)'
I've had this problem before with a different gem and still don't know how to get around it.
Turns out the rails3 branch of the original ajaxful_rating gem works with either jQuery or Prototype.
This worked for me:
#Gemfile
gem 'ajaxful_rating', :git => 'git://github.com/edgarjs/ajaxful-rating.git', :branch => "rails3"
#config/routes.rb
resources :modelname do
member do
post :rate
end
end
I think you're trying to retrieve the wrong gem. Try:
gem 'ajaxful_rating', :git => "git://github.com/edgarjs/ajaxful-rating.git", :branch => 'rails3'
If you want to add rating capability for you rails 3.1 and higher application you can check the new gem called letsrate.
I can't test this easily right now due to proxy problems, but it looks to me as though the gemspec file is named wrongly in the Rails 3 branch.
It's called ajaxful_rating.gemspec and bundler will be looking for ajaxful_rating_jquery.gemspec.
Try forking the project and changing the gemspec name, perhaps?
This is a guess, since I'm not able to test this at my current comp, but it looks like the require is different on the gem itself, than what you're pulling in. Give this a shot:
gem 'ajaxful_rating_jquery',
:git => "git://github.com/kamui/ajaxful_rating_jquery.git",
:branch => "rails3",
:require => "ajaxful_rating"
精彩评论