Rails 3应用程序中未初始化的常量Compass
我试图在我的 Rails 3 应用程序中使用 fancy-buttons gem 但现在我什至无法启动我的本地服务器因为这个错误:
$:~/rails/project$rails 服务器 /usr/lib/ruby/gems/1.8/gems/fancy-buttons-1.0.6/lib/fancy-buttons.rb:1:未初始化的常量 Compass (名称错误)
这就是我的 gemfile 的样子:
gem "fancy-buttons"
gem 'haml'
gem 'haml-rails'
gem 'compass', ">= 0.10.6"
我已经运行了 bundle update
和 bundle install
Using haml (3.0.25)
Using compass (0.10.6)
Using fancy-buttons (1.0.6)
我该如何解决这个问题?
I was trying to use fancy-buttons gem in my rails 3 app but now I can not even start my local server because of this error:
$:~/rails/project$ rails server
/usr/lib/ruby/gems/1.8/gems/fancy-buttons-1.0.6/lib/fancy-buttons.rb:1: uninitialized constant Compass
(NameError)
This is what my gemfile looks like:
gem "fancy-buttons"
gem 'haml'
gem 'haml-rails'
gem 'compass', ">= 0.10.6"
I've ran bundle update
and bundle install
Using haml (3.0.25)
Using compass (0.10.6)
Using fancy-buttons (1.0.6)
How can I fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 gem 文件中,指南针需要位于精美按钮之前。这确保了它在 fancy-buttons 尝试需要它之前加载,因为 gemfile 中的 gem 按顺序加载。
Compass needs to come before fancy-buttons in your gemfile. This ensures that it is loaded before fancy-buttons tries to require it as the gems in your gemfile are loaded in order.