rails未初始化的常量Sprockets :: SassCacheStore [英] rails uninitialized constant Sprockets::SassCacheStore
问题描述
我的情况是,我在我的网站上有这个导航菜单,并且还有一些其他的功能,我需要选择current_page链接..而不是建立一个帮手我想安装一个gem,所以我去找了一个,发现
然后我跟着文档说了什么:
在我的gemfile我添加了
gem'rack_current_page'
然后在项目根目录 config.ru
require :: File.expand_path('../ config / environment', __FILE__)
使用Rack :: CurrentPage
run Rails.application
最后我跑了:
bundle
和 rails s
only to发现我有这个错误:
$ b $ 未初始化的常量Sprockets :: SassCacheStore
我使用下列软件包/版本(只列出可能会有影响的内容 - 如果我'我错过了一些东西让我知道)
(< gem> -v)
删除我添加的每一行 - 赫克我也重置我的项目文件头,因为我刚开始工作,无论如何,
运行一个新的包,重新启动服务器,检查网站,但我所得到的是上述错误..
我搜索并尝试寻找类似的问题,所以找不到任何这样的事情,我唯一真正可以尝试的是卸载并重置我的git 。
我确实在寻找一些非常愚蠢的东西,但无法真正在这里找到答案;)
$ b $如果我错过了你们需要的信息,请提前和评论。 任何帮助都很好, p>
我实际上做了一个快速的 gem pristine --all
,但没有结果。
编辑1
好的,因为在短时间内重新创建了一个新应用程序,因此在猜测和发生相同情况之前,我卸载了 compass-rails
gem并运行 bundle
之后 rails s
来测试是否开始工作。
它的确如此。然后,我继续重新安装 compass-rails
,它一直在工作......现在变得非常困惑:S
我发现了这个问题,并且通过实际提供的解决方案解决了这个问题。
使用rails 4.2的版本。
默认的 gem compass-rails
会安装与链轮不兼容的版本。 / p>
当我添加特定版本时,可以看到 ,然后运行另一个 bundle
我在问题中命名的大部分软件包的版本都发生了变化。
在包含gemfile修改后的控制台输出:
安装链轮2.12。 3(3.0.0)
使用sprockets-rails 2.3.1(是2.2.4)
安装sass-rails 5.0.1(5.0.3)
安装compass-rails 2.0 .4(是2.0.1)
猜测它只是在等待指南针发布兼容版本。
I'm new to rails and trying to do some playing around with gems and such.
My case here is that I have this navigation menu on my website and I needed to get the current_page link selected.. rather than building a helper I wanted to install a gem so I went and looked for one and found this one.
I then followed what the documentation said:
In my gemfile I added
gem 'rack_current_page'
Then in the project root
config.ru
require ::File.expand_path('../config/environment', __FILE__) use Rack::CurrentPage run Rails.application
And finally I ran:
bundle
andrails s
only to find out I had this error:
uninitialized constant Sprockets::SassCacheStore
The error happens when including the application stylesheet in the layout file.
I'm using the following packages / versions (only listing what might have impact - if I'm missing something let me know)
(<gem> -v)
- Rails 4.2.1
- Sprockets 3.0.0
- Sass 3.4.13
- Rack 1.5
While doing the uninstall I removed every line I added - heck I also reset my project files to head since I just started working on it anyways, ran a fresh bundle, restarted the server, checked the site but all I'm getting is the error above..
I googled and tried to look for a similar question on SO but couldn't find any so the only thing I could really try was the uninstall and reset my git.
I'm definitely looking over something really stupid but can't really find the answer so here I am ;)
Any help is appriciated, thanks in advance and comment if I missed info that you guys need.
time of writing
I actually did a quick gem pristine --all
with no results either.
EDIT 1
Okay, so with abit of guesswork and the same situation happening before resulting in the recreation of a fresh app in the (short) past I uninstalled the compass-rails
gem and ran bundle
afterwhich rails s
to test if things started working.
It did. Then I went on and reinstalled compass-rails
and it kept working... getting quite confused now :S
Okay so here goes:
I've found the problem and it was solved by actually supplying a version that works with rails 4.2.
The default gem compass-rails
installs a version incompatible with sprockets.
When I added the specific version as seen here and ran another bundle
the versions of most of the packages I named in the question changed.
console output after gemfile modification included:
Installing sprockets 2.12.3 (was 3.0.0)
Using sprockets-rails 2.3.1 (was 2.2.4)
Installing sass-rails 5.0.1 (was 5.0.3)
Installing compass-rails 2.0.4 (was 2.0.1)
Guess it's just waiting for compass to release a compatible version.
这篇关于rails未初始化的常量Sprockets :: SassCacheStore的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!