Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.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
Ruby rails-资源的路由错误_Ruby_Ruby On Rails 3 - Fatal编程技术网

Ruby rails-资源的路由错误

Ruby rails-资源的路由错误,ruby,ruby-on-rails-3,Ruby,Ruby On Rails 3,我的开发rails环境无法读取图像文件。我在development.rb中添加了config.service\u static\u assets=false。但这并没有解决问题。我还需要换什么 Started GET "/assets/images/ui-icons_888888_256x240.png" for 10.10.10.10 at 2012-05-12 22:02:32 -0400 Served asset /images/ui-icons_888888_256x240.png -

我的开发rails环境无法读取图像文件。我在
development.rb
中添加了
config.service\u static\u assets=false
。但这并没有解决问题。我还需要换什么

Started GET "/assets/images/ui-icons_888888_256x240.png" for 10.10.10.10 at 2012-05-12 22:02:32 -0400
Served asset /images/ui-icons_888888_256x240.png - 404 Not Found (45ms)

ActionController::RoutingError (No route matches [GET] "/assets/images/ui-icons_888888_256x240.png"):

确保您的
config/application.rb
配置为使用资产管道

config.assets.enabled = true
此外,请确保您的文件位于正确的位置

/app/assets/images/ui-icons_888888_256x240.png
现在您已经提到您正在使用jQuery UI,您需要确保可以找到资产。通常,您希望在以下位置找到它们:

/vendor/assets/images/*

你如何做到这一点取决于你自己。您可以将所有图像从jQuery UI下载中的任何位置复制到该目录。

和config.assets.debug=true?我正在使用jQuery UI。图像文件名总是在更改。不知道jQuery是如何追踪其资产的。编辑我的答案以反映这一发现。马克·佩恩你真的是我的英雄。从Rails 4.0转换到Rails 3.2,我的资产在哪里找不到,为什么?因为你首先提到的那句话根本就不在那里。谢谢你的回答