1

我最近将 Rails 3.0 升级到 3.2.3 并尝试安装 twitter bootstrap 但收到以下错误。

>> rails g bootstrap:install

DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /home/xyz/Desktop/projects/proj-clone/wow/config/environment.rb:5)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /home/xyz/Desktop/projects/proj-clone/wow/config/environment.rb:5)
/home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.2.3/lib/active_record/dynamic_matchers.rb:50:in `method_missing': undefined method `class_inheritable_accessor' for #<Class:0xa069280> (NoMethodError)
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/bundler/gems/simple-private-messages-7461f5a05fc9/lib/has_private_messages_extensions.rb:17:in `has_private_messages'
from /home/xyz/Desktop/projects/proj-clone/wow/app/models/user.rb:14:in `<class:User>'
from /home/xyz/Desktop/projects/proj-clone/wow/app/models/user.rb:1:in `<top (required)>'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:469:in `load'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:469:in `block in load_file'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:639:in `new_constants_in'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:468:in `load_file'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:353:in `require_or_load'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:502:in `load_missing_constant'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:192:in `block in const_missing'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:190:in `each'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:190:in `const_missing'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2.2/lib/rake/ext/module.rb:36:in `const_missing'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:229:in `block in constantize'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:228:in `each'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:228:in `constantize'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:554:in `get'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:588:in `constantize'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.4.5/lib/devise.rb:259:in `get'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.4.5/lib/devise/mapping.rb:101:in `to'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.4.5/lib/devise/mapping.rb:96:in `modules'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.4.5/lib/devise/mapping.rb:113:in `routes'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.4.5/lib/devise/mapping.rb:82:in `initialize'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.4.5/lib/devise.rb:289:in `new'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.4.5/lib/devise.rb:289:in `add_mapping'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.4.5/lib/devise/rails/routes.rb:191:in `block in devise_for'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.4.5/lib/devise/rails/routes.rb:190:in `each'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/devise-1.4.5/lib/devise/rails/routes.rb:190:in `devise_for'
from /home/xyz/Desktop/projects/proj-clone/wow/config/routes.rb:77:in `block in <top (required)>'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:282:in `instance_exec'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:282:in `eval_block'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:260:in `draw'
from /home/xyz/Desktop/projects/proj-clone/wow/config/routes.rb:1:in `<top (required)>'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:in `load'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:in `block in load'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:in `load'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.3/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.3/lib/rails/application/routes_reloader.rb:40:in `each'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.3/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.3/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.3/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/file_update_checker.rb:78:in `call'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/file_update_checker.rb:78:in `execute'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.3/lib/rails/application/routes_reloader.rb:27:in `updater'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.3/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.3/lib/rails/application/finisher.rb:66:in `block in <module:Finisher>'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `each'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `run_initializers'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.3/lib/rails/application.rb:136:in `initialize!'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/xyz/Desktop/projects/proj-clone/wow/config/environment.rb:5:in `<top (required)>'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.3/lib/rails/application.rb:103:in `require_environment!'
from /home/xyz/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.2.3/lib/rails/commands.rb:25:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

下面是我的gemfile

gem 'rails', '3.2.3'
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
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', :platform => :ruby

  gem 'uglifier', '>= 1.0.3'
end

如何解决?谢谢。

4

1 回答 1

0

simple-private-messages我正在使用导致问题的 in gem 文件的分叉版本。更改它以gem 'simple-private-messages', '0.0.0', :git => 'git://github.com/jongilbraith/simple-private-messages.git'解决问题。

可能是与 gem 兼容性有关的问题。我删除gem will_paginate并添加gem 'therubyracer', :platform => :ruby到 gem 文件中。

于 2012-09-12T05:46:57.993 回答