使用`acts_as_taggable_on`时为什么会出现这个简单的错误?

时间:2013-04-04 08:02:34

标签: ruby-on-rails ruby-on-rails-3 passenger acts-as-taggable-on

我想设置ActsAsTaggableOn.strict_case_match = true
根据{{​​3}},似乎我必须从github下载gem。所以我就这样做了,试着运行App。

但是,它会返回此错误:(

错误消息:(我已尝试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

这是我的代码!

  • 配置/初始化/ 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'


我尝试更改源代码以直接从gemyorg下载gem,而不是从Github下载。就像这样。

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

现在它返回此错误:(

错误讯息:

undefined method `strict_case_match=' for ActsAsTaggableOn:Module

我该如何解决这个问题?

更新:

的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'

1 个答案:

答案 0 :(得分:2)

问题是act-as-taggable-on版本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.lock并运行bundle install和bundle update

请注意,它是宝石的开发版本,尚未准备好投入生产,但您可以承担风险并成为宝石的alpha用户并报告您发现的任何问题:)