Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css can';t访问资产文件夹中的图像(ruby on rails)_Css_Ruby On Rails - Fatal编程技术网

Css can';t访问资产文件夹中的图像(ruby on rails)

Css can';t访问资产文件夹中的图像(ruby on rails),css,ruby-on-rails,Css,Ruby On Rails,我正在尝试访问scss文件中/assets/images目录中的图像,如下所示: background-image: url(/assests/traffic_lights_red.png); 一无所获 当我使用http://localhost:3000/assests/traffic_lights_red.png我收到一个路由错误:没有匹配的路由[get]“/assests/traffic\u lights\u red.png” 我已经阅读了一些关于这个主题的其他帖子,看起来应该可以了,为什

我正在尝试访问scss文件中/assets/images目录中的图像,如下所示:

background-image: url(/assests/traffic_lights_red.png);
一无所获 当我使用
http://localhost:3000/assests/traffic_lights_red.png
我收到一个路由错误:
没有匹配的路由[get]“/assests/traffic\u lights\u red.png”

我已经阅读了一些关于这个主题的其他帖子,看起来应该可以了,为什么会出现路由错误?
谢谢

这可能是一个愚蠢的答案,因为它可能是一个打字错误,但是

background-image: url(/assests/traffic_lights_red.png);
应该是

background-image: url(/assets/traffic_lights_red.png);

没错!我总是对自己的打字错误视而不见谢谢哈:)我真的以为那个打字错误只是问题中的一个打字错误。但我知道你的感受。。我们经常会在别人看不到的时候,在一秒钟内就发现我们的打字错误。