2

在使用脚手架创建一些代码后,我遇到了一个奇怪的错误。现在,任何新的生成或销毁命令都会出现以下错误。

$ rails destroy scaffold Plugin

/Library/Ruby/Gems/1.8/gems/sass-rails-3.2.5/lib/sass/rails/railtie.rb:46: uninitialized constant Sass::Plugin (NameError)
from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:34:in `call'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:43:in `run_load_hooks'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:42:in `each'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/application/finisher.rb:59
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `run_initializers'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:54:in 'each'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:54:in 'run_initializers'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/application.rb:136:in 'initialize!'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `send'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Applications/XAMPP/xamppfiles/htdocs/monaco/config/environment.rb:5
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/application.rb:103:in 'require'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/application.rb:103:in 'require_environment!'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:25
from script/rails:6:in `require'
from script/rails:6
4

1 回答 1

0

根据错误日志,您可以尝试两个选项:

1) Comment one line something like gem 'sass' in Gemfile due to name conflict of Plugin 
2) Configure Sass gem properly

然后很可能您将能够正确运行新的生成和销毁命令。

于 2012-12-14T08:46:00.207 回答