2

我想成立ActsAsTaggableOn.strict_case_match = true
根據http://5minutenpause.com/blog/2012/11/20/careful-where-you-get-your-gems-from/,似乎我必須從github下載gem。所以我這樣做了,試圖運行App。爲什麼在使用`acts_as_taggable_on`時會出現這個簡單的錯誤?

然而,返回該錯誤:(

錯誤信息:(!我已經嘗試bundle install,但仍是同樣的錯誤消息)

git://github.com/mbleigh/acts-as-taggable-on.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError) 
Exception class: 
    PhusionPassenger::UnknownError 

這裏是我的代碼!

  • config/initializer/tag_list.rb

    ActsAsTaggableOn.delimiter = ','
    ActsAsTaggableOn.remove_unused_tags = true
    ActsAsTaggableOn.strict_case_match = true

  • 的Gemfile

    gem 'acts-as-taggable-on', git: 'git://github.com/mbleigh/acts-as-taggable-on.git'


我做了一個嘗試,從到rubyorg,更改源直接下載寶石不是來自Github。就是這樣。

gem 'acts-as-taggable-on', '2.3.3' 

現在返回該錯誤:(

錯誤消息:

undefined method `strict_case_match=' for ActsAsTaggableOn:Module 

我怎樣才能解決這個

UPDATE:

的Gemfile

source 'https://rubygems.org' 

gem 'rails', '3.2.11' 

# Bundle edge Rails instead: 
# gem 'rails', :git => 'git://github.com/rails/rails.git' 

gem 'mysql2' 
gem 'execjs' 
gem 'therubyracer' 
gem 'devise', '2.0.1' 
gem 'recaptcha', :require => 'recaptcha/rails' 
gem 'paperclip', "~> 3.0" 
gem "cocaine" 
gem 'mailboxer', '0.7.0' 
gem 'sunspot_rails' 
gem 'sunspot_solr' 
group :development do 
    gem 'better_errors' 
    gem 'binding_of_caller' 
    #gem 'rack-mini-profiler' 
end 
gem 'progress_bar' 
gem 'kaminari', '0.14.0' 
gem "sunspot_with_kaminari", '~> 0.1' 
gem 'i18n_generators' 
gem 'ancestry' 
gem 'acts-as-taggable-on', '2.3.3' 

gem 'acts_as_commentable_with_threading' 

gem 'twitter-bootstrap-rails' 
gem "less-rails" 

gem 'crummy', '~> 1.6.0' 

gem 'rails3_acts_as_paranoid' 

gem 'galetahub-simple_captcha', :require => 'simple_captcha' 

gem "acts_as_follower" 

gem "jpmobile" 

gem "rqrcode-rails3" 

gem 'acts_as_votable', '~> 0.4.0' 

gem 'rails3-jquery-autocomplete' 

gem "cancan" 

gem 'rinku', '1.5.1' 

gem 'dalli' 

gem "auto_html", '1.6.0' 

gem "rails_autolink" 




# Gems used only for assets and not required 
# in production environments by default. 
group :assets do 
    gem 'sass-rails', '~> 3.2.3' 
    gem 'coffee-rails', '~> 3.2.1' 

    # See https://github.com/sstephenson/execjs#readme for more supported runtimes 
    # gem 'therubyracer', :platforms => :ruby 

    gem 'uglifier', '>= 1.0.3' 
    gem 'jquery-ui-rails' 

end 

gem 'jquery-rails' 



# To use ActiveModel has_secure_password 
# gem 'bcrypt-ruby', '~> 3.0.0' 

# To use Jbuilder templates for JSON 
# gem 'jbuilder' 

# Use unicorn as the app server 
# gem 'unicorn' 

# Deploy with Capistrano 
# gem 'capistrano' 

# To use debugger 
# gem 'debugger' 

回答

2

的問題是,從行爲-AS-加標籤,在版本2.3.3 9個月前發佈的,並且不包括strict_case_match功能。

你的Gemfile有太多的看這本:

gem 'acts-as-taggable-on', git: 'git://github.com/mbleigh/acts-as-taggable-on.git' 

你有同樣的方式,並運行:

bundle update acts-as-taggable-on 

如果不工作,只是刪除您的Gemfile。鎖定並運行捆綁包安裝和捆綁更新

注意到它是寶石的開發版本,尚未準備好生產,但您可以承擔風險併成爲寶石的alpha用戶,並報告發現的任何問題:)

+0

感謝您的回覆:)我試過你告訴我要做的一切。但它仍然有同樣的錯誤。 – cat 2013-04-04 08:26:50

+0

ups,對不起,你有你的git代碼,對不對?只需運行:** git reset Gemfile.lock ** – rorra 2013-04-04 08:40:32

+0

沒關係。只有一顆寶石失去了一個特徵。所以我爲Gemfile添加了精確的版本。現在一切都好了。 'git reset Gemfile.lock'做什麼?你認爲這會解決我的問題嗎? – cat 2013-04-04 08:47:37

相關問題