我正在创建一个 Grails Web 应用程序,当我在本地部署应用程序时一切正常,它启动时没有问题,但是当我尝试部署到 Heroku 或 CloudFoundry 时,我从 CF 中的日志中收到以下错误:
2012-10-15 12:14:15,865 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /bootstrap/css/bootstrap-responsive.css
2012-10-15 12:14:15,866 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /kickstart/css/docs.css
2012-10-15 12:14:15,867 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /kickstart/css/kickstart.css
2012-10-15 12:14:15,867 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /datepicker/css/datepicker.css
2012-10-15 12:14:15,868 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /bootstrap/js/bootstrap.js
2012-10-15 12:14:15,868 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /datepicker/js/bootstrap-datepicker.js
2012-10-15 12:14:15,869 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /kickstart/js/kickstart.js
2012-10-15 12:14:17,506 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /bootstrap/css/bootstrap.css
2012-10-15 12:14:17,506 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /bootstrap/css/bootstrap-responsive.css
2012-10-15 12:14:17,507 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /kickstart/css/docs.css
2012-10-15 12:14:17,507 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /kickstart/css/kickstart.css
2012-10-15 12:14:17,508 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /datepicker/css/datepicker.css
2012-10-15 12:14:17,508 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /bootstrap/js/bootstrap.js
2012-10-15 12:14:17,509 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /datepicker/js/bootstrap-datepicker.js
2012-10-15 12:14:17,509 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /kickstart/js/kickstart.js
2012-10-15 12:14:19,042 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /bootstrap/css/bootstrap.css
2012-10-15 12:14:19,043 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /bootstrap/css/bootstrap-responsive.css
2012-10-15 12:14:19,043 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /kickstart/css/docs.css
2012-10-15 12:14:19,044 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /kickstart/css/kickstart.css
2012-10-15 12:14:19,044 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /datepicker/css/datepicker.css
2012-10-15 12:14:19,045 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /bootstrap/js/bootstrap.js
2012-10-15 12:14:19,045 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /datepicker/js/bootstrap-datepicker.js
2012-10-15 12:14:19,045 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /kickstart/js/kickstart.js
2012-10-15 12:14:20,248 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /bootstrap/css/bootstrap.css
2012-10-15 12:14:20,249 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /bootstrap/css/bootstrap-responsive.css
2012-10-15 12:14:20,249 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /kickstart/css/docs.css
2012-10-15 12:14:20,250 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /kickstart/css/kickstart.css
2012-10-15 12:14:20,250 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /datepicker/css/datepicker.css
2012-10-15 12:14:20,251 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /bootstrap/js/bootstrap.js
2012-10-15 12:14:20,251 [http-28586-1] ERROR resource.ResourceMeta - Resource not found: /datepicker/js/bootstrap-datepicker.js
2012-10-15 12:14:20,252 [http-28586-1] ERROR resource.ResourceMeta - Resource not
这个应用程序使用位于根目录下名为“plugins”的文件夹中的内嵌插件。然后我在BuildConfig.groovy中有这段代码来引用插件:
grails.plugin.location.'spring-security-ui'="plugins/grails-spring-security-ui"
grails.plugin.location.'kickstart-with-bootstrap'="plugins/ui"
一旦我使用内联插件,我才开始遇到将应用程序部署到云端的问题,以前从未遇到过这个问题:-S 谁能帮我解决这个问题,因为它非常烦人,我相信它是由“资源”引起的插入。
请注意,我已确保以下代码位于config.groovy文件中:
grails.resources.adhoc.patterns = ['/images/*', '/css/*', '/js/*', '/plugins/*']