在rails 4中安装客户端验证gem

时间:2014-02-26 10:02:10

标签: ruby-on-rails ruby-on-rails-4 rubygems bundler

我正在使用rails 4.我必须进行客户端验证,所以,我已经安装了gem

gem 'client_side_validations', git: 'git://github.com/bcardarella/client_side_validations.git', branch: '4-0-beta'

但捆绑时抛出错误。

Updating git://github.com/bcardarella/client_side_validations.git
Fetching source index from http://rubygems.org/
Retrying source fetch due to error (2/3): Bundler::HTTPError Could not fetch specs from http://rubygems.org/
Retrying source fetch due to error (3/3): Bundler::HTTPError Could not fetch specs from http://rubygems.org/
Could not fetch specs from http://rubygems.org/

的Gemfile

source 'http://rubygems.org'

gem 'rails', '4.0.2'
gem 'pg'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'fullcalendar-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
gem 'thin'
gem 'bcrypt-ruby', '~> 3.1.2'
gem 'twitter-bootstrap-rails'
gem 'therubyracer', platforms: :ruby
gem 'less-rails'
gem 'activerecord-session_store', github: 'rails/activerecord-session_store'
gem 'unicorn'
gem 'capistrano', group: :development
gem 'debugger', group: [:development, :test]
gem 'jquery-datatables-rails', git: 'git://github.com/rweng/jquery-datatables-rails.git'
gem 'jquery-turbolinks'
gem 'better_errors'
gem "paperclip", "~> 4.1"
gem 'client_side_validations', git: 'git://github.com/bcardarella/client_side_validations.git', branch: '4-0-beta'

#gem 'client_side_validations'
group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

请帮帮我?

2 个答案:

答案 0 :(得分:0)

尝试更改

source 'http://rubygems.org'

source 'https://rubygems.org'

答案 1 :(得分:0)

在GEM文件中

gem 'rails4_client_side_validations', '~> 0.0.4'

在终端运行中

bundle install