无法通过 rake assets:precompile 预编译 rails 应用程序中的所有文件 (app\assets)

Cannot precompile all files (app\assets) in rails application though rake assets:precompile

我有一个 rails 应用程序,现在尝试 运行 它到我在 Win2012 上的本地服务器。

https://github.com/carloscoca/loccasions

我尝试通过命令 rake assets:precompile 预编译 app\assets 中的所有文件,但没有出现错误。

但是,我 运行 该网站虽然是本地主机,但看起来不完整,它需要一些文件,我检查了日志文件。 (有些文件是预编译的,有些不是,在清单文件中是一样的)。

我试过了 config.assets.compile = true,没有结果,还有一些配置,运气不好

Started GET "/stylesheets/layout.css" for 127.0.0.1 at 2015-06-07 10:28:45 -0400

ActionController::RoutingError (No route matches [GET] "/stylesheets/layout.css"):


Rendered C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.0ms)


Started GET "/assets/default.css" for 127.0.0.1 at 2015-06-07 10:28:45 -0400
Served asset /default.css - 404 Not Found (2ms)

ActionController::RoutingError (No route matches [GET] "/assets/default.css"):


Rendered C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.0ms)


Started GET "/assets/default.js" for 127.0.0.1 at 2015-06-07 10:28:45 -0400
Served asset /default.js - 404 Not Found (0ms)

ActionController::RoutingError (No route matches [GET] "/assets/default.js"):


Rendered C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.0ms)


Started GET "/stylesheets/skeleton.css" for 127.0.0.1 at 2015-06-07 10:28:45 -0400

ActionController::RoutingError (No route matches [GET] "/stylesheets/skeleton.css"):


Rendered C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.0ms)


Started GET "/stylesheets/base.css" for 127.0.0.1 at 2015-06-07 10:28:45 -0400

ActionController::RoutingError (No route matches [GET] "/stylesheets/base.css"):


Rendered C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.0ms)


Started GET "/javascripts/tabs.js" for 127.0.0.1 at 2015-06-07 10:28:45 -0400

ActionController::RoutingError (No route matches [GET] "/javascripts/tabs.js"):


Rendered C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.0ms)

这对我有用,这个答案属于 "coded addicted"

在您的 config/application.rb 中,您可能需要在此行中添加特定文件:config.assets.precompile += %w(base., skeleton . .....)