Rails(带Heroku)资产是​​否应该在`public`目录中?

时间:2015-05-12 02:09:25

标签: ruby-on-rails heroku

我的app/assets目录中有一些内容,一切都在我的本地开发环境中正常运行,但当我将它全部推送到Heroku时,我加载页面,控制台中有一个404用于背景图像和字体Stringfellows

为什么会这样?

我不想为您提供过多的调试信息,所以请问,我会高兴地发布它!

首先,我认为你会喜欢看到一些事情:

environment.rb

# Load the Rails application.
require File.expand_path('../application', __FILE__)

# Initialize the Rails application.
Rails.application.initialize!

development.rb

Rails.application.configure do
  config.cache_classes = false
  config.eager_load = false
  config.consider_all_requests_local       = true
  config.action_controller.perform_caching = false
  config.action_mailer.raise_delivery_errors = false
  config.active_support.deprecation = :log
  config.active_record.migration_error = :page_load
  config.assets.raise_runtime_errors = true
end

production.rb

Rails.application.configure do
  config.cache_classes = true
  config.eager_load = true
  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true
  config.assets.js_compressor = :uglifier
  config.assets.compile = false
  config.assets.digest = true
  config.log_level = :info
  config.i18n.fallbacks = true
  config.active_support.deprecation = :notify
  config.log_formatter = ::Logger::Formatter.new
  config.active_record.dump_schema_after_migration = false
end

test.rb(我甚至不知道这是为了什么。?):

Rails.application.configure do
  config.cache_classes = true
  config.eager_load = false
  config.consider_all_requests_local       = true
  config.action_controller.perform_caching = false
  config.action_dispatch.show_exceptions = false
  config.action_controller.allow_forgery_protection = false
  config.action_mailer.delivery_method = :test
  config.active_support.deprecation = :stderr
end

tree

.
├── Gemfile
├── Gemfile.lock
├── Procfile
├── README.md
├── Rakefile
├── app
│   ├── assets
│   │   ├── fonts
│   │   │   └── Stringfellows.otf
│   │   ├── images
│   │   │   ├── Background.jpg
│   │   │   ├── Glyphicons-66-Tag.png
│   │   │   ├── Image.jpg
│   │   │   └── Seperator.png
│   │   ├── javascripts
│   │   │   ├── application.js
│   │   │   ├── tags.js.coffee
│   │   │   └── welcome.js.coffee
│   │   └── stylesheets
│   │       ├── application.css
│   │       ├── scaffolds.css.scss
│   │       ├── tags.css.scss
│   │       └── welcome.css.scss
│   ├── controllers
│   │   ├── application_controller.rb
│   │   ├── concerns
│   │   ├── tags_controller.rb
│   │   └── welcome_controller.rb
│   ├── helpers
│   │   ├── application_helper.rb
│   │   ├── tags_helper.rb
│   │   └── welcome_helper.rb
│   ├── mailers
│   ├── models
│   │   ├── concerns
│   │   └── widget.rb
│   └── views
│       ├── layouts
│       │   └── application.html.erb
│       ├── tags
│       │   ├── all.html.erb
│       │   └── tagged_as.html.erb
│       └── welcome
│           └── index.html.erb
├── bin
│   ├── bundle
│   ├── rails
│   ├── rake
│   └── spring
├── config
│   ├── application.rb
│   ├── boot.rb
│   ├── database.yml
│   ├── environment.rb
│   ├── environments
│   │   ├── development.rb
│   │   ├── production.rb
│   │   └── test.rb
│   ├── initializers
│   │   ├── assets.rb
│   │   ├── backtrace_silencers.rb
│   │   ├── cookies_serializer.rb
│   │   ├── filter_parameter_logging.rb
│   │   ├── inflections.rb
│   │   ├── mime_types.rb
│   │   ├── session_store.rb
│   │   └── wrap_parameters.rb
│   ├── locales
│   │   └── en.yml
│   ├── puma.rb
│   ├── routes.rb
│   └── secrets.yml
├── config.ru
├── db
│   ├── migrate
│   ├── schema.rb
│   └── seeds.rb
├── lib
│   ├── assets
│   └── tasks
├── log
│   ├── development.log
│   └── production.log
├── public
│   ├── 404.html
│   ├── 422.html
│   ├── 500.html
│   ├── assets
│   │   ├── Background-2ab8f2f700ecbd72569365c0687845e6.jpg
│   │   ├── Glyphicons-66-Tag-c6bb34b470710c050b67bb46e0534edc.png
│   │   ├── Image-4d75a05527759e7daae511c9665c281b.jpg
│   │   ├── Seperator-ef9bbf91f3385b080030dcdbd11c918f.png
│   │   ├── Stringfellows-109ad049fabfd693323bd399a139ae31.otf
│   │   ├── application-0647e85d123c0de0a477a4c0def7bc09.css
│   │   ├── application-0647e85d123c0de0a477a4c0def7bc09.css.gz
│   │   ├── application-16da03a5233f3ec1a05955a4a83d2720.js
│   │   ├── application-16da03a5233f3ec1a05955a4a83d2720.js.gz
│   │   └── manifest-93a4fe70ee03a51141dd51a043f54efe.json
│   ├── favicon.ico
│   └── robots.txt
├── test
│   ├── controllers
│   │   ├── tags_controller_test.rb
│   │   └── welcome_controller_test.rb
│   ├── fixtures
│   ├── helpers
│   │   ├── tags_helper_test.rb
│   │   └── welcome_helper_test.rb
│   ├── integration
│   ├── mailers
│   ├── models
│   │   └── widget_test.rb
│   └── test_helper.rb
├── tmp
│   ├── cache
│   │   └── assets
│   │       ├── development
│   │       │   ├── sass
│   │       │   │   ├── 8b09e0f86ea12ee8290180fbc9a39608912a0659
│   │       │   │   │   ├── scaffolds.css.scssc
│   │       │   │   │   ├── tags.css.scssc
│   │       │   │   │   └── welcome.css.scssc
│   │       │   │   └── bf84c68a0d37df7db1579e67a910e08e5399570e
│   │       │   │       ├── scaffolds.css.scssc
│   │       │   │       └── welcome.css.scssc
│   │       │   └── sprockets
│   │       │       ├── 01fd33067344de80b279c9ab59c62b8e
│   │       │       ├── 053228ae14696eb3ddaf69e94d9fd5ce
│   │       │       ├── 0cd10c83ff059a2f4b69b59b8d0abccd
│   │       │       ├── 10fcfbe6ebae11a40c8eac41939a1b9a
│   │       │       ├── 13724b4dfae7494c1e520fcbbd08d24b
│   │       │       ├── 13fe41fee1fe35b49d145bcc06610705
│   │       │       ├── 15c5ee4c79cbf0cb594aecaad8558324
│   │       │       ├── 220ac4424b82b400ec47fe0570c5aa7f
│   │       │       ├── 2211190fb757d05874e2b25fc37a31ad
│   │       │       ├── 22d2e048e0bec6ffbc97df4e305e68f6
│   │       │       ├── 2f2229c70dcf195564d4d0fd6a12ac1a
│   │       │       ├── 2f5173deea6c795b8fdde723bb4b63af
│   │       │       ├── 3233432f81669b9bd10ef726c526d348
│   │       │       ├── 357970feca3ac29060c1e3861e2c0953
│   │       │       ├── 381c3fb00e2c26626c05caaecf1486a7
│   │       │       ├── 3eb741824c944c68c6061bc832d8c592
│   │       │       ├── 3fc891487990163819656e9afd02e551
│   │       │       ├── 45124d5a7a9b96db119f6165e046eafc
│   │       │       ├── 46be8c7873191a815eed6b2724296981
│   │       │       ├── 4ce1278e2fba1b9accc354db70cb0146
│   │       │       ├── 53c8bec9ded3bda0b2d1b617db73a38f
│   │       │       ├── 56e9c68d1d8f2475f9b080148503ec36
│   │       │       ├── 60bbf1fc573c8bc35c8da9082888cb6c
│   │       │       ├── 6391f74459ccc20c2e40d8c4ce96ee9f
│   │       │       ├── 64e51b49f238ea58dc5100d1a46bffc1
│   │       │       ├── 687381e944802a1959f44214098706b3
│   │       │       ├── 69021c0e9ed98d6dcf40cffab5fc972d
│   │       │       ├── 696b212ad3e7ab9a0177e752628d5969
│   │       │       ├── 6a977b85c07b470831923de1aca7a0c4
│   │       │       ├── 6b3fe3371a3f93546be7428e93944132
│   │       │       ├── 6d4c88be30a51243488372645e529be5
│   │       │       ├── 75ea20b361b20f36734b5fa29c8aedcc
│   │       │       ├── 84a859bf0c182b733ab1b934aabbd128
│   │       │       ├── 84ea3899ca539e375b5ea06e94a83d7c
│   │       │       ├── 86042d3480d349fd4b8a53aa0147c118
│   │       │       ├── 90453c5b48e1f0a4f1a6836135c1c4b1
│   │       │       ├── 9061204a216ee9a38046135ec4eeca12
│   │       │       ├── 93708cb34051f3000884905e8669d74a
│   │       │       ├── 93a911c9073a7c776fe45c38d46d3fe8
│   │       │       ├── 9be6a82e473af59ae2340c17a2dde91a
│   │       │       ├── a07199ac60b03165653204def7c620e2
│   │       │       ├── a454589e855a885069944f9e98078ee9
│   │       │       ├── a6d4fade9aac0bf5f14d1fa76e77168a
│   │       │       ├── ad211ce30bd1790a018501b6923f2322
│   │       │       ├── b01377759f7d414381eafa837b2cdca0
│   │       │       ├── b1a865a07fc4afd3e74affecc4859ad2
│   │       │       ├── b3338a3082e7f84f3f105ab6e05da72f
│   │       │       ├── b68a6c71aff58d8aa32ce08963436079
│   │       │       ├── bcd83911af97bc5f2f9de4aa499ff146
│   │       │       ├── bd3936370d0f952ada5774e2230046ed
│   │       │       ├── bd71546009ab5e606b3f27b4c6a79856
│   │       │       ├── c6b226b1d17b860b6e1fd0434897280b
│   │       │       ├── c8870bbe1cf0d62508a60ea5da10c1cf
│   │       │       ├── cbcfd0cef8dcc33ce7f1c45295e2122f
│   │       │       ├── cffd775d018f68ce5dba1ee0d951a994
│   │       │       ├── d503494ea57174417f2b86ce6657578a
│   │       │       ├── d6d6cf5ff58edce3840dc45621fb1a1d
│   │       │       ├── d771ace226fc8215a3572e0aa35bb0d6
│   │       │       ├── e459168835a5f27b832ace20874f7c10
│   │       │       ├── e96d6509ed5b04a3a4c58645d8252e8c
│   │       │       ├── ea7ac69765f47d6189ed8644f4ebefdd
│   │       │       ├── ec11adc4439b4dcd2e5c2959f0c53fc1
│   │       │       ├── ef8d5c64086767d170b6aae6bbca27e7
│   │       │       ├── efa49ae10258392a4ed861597b74936e
│   │       │       ├── f1106c076867a3a612534353347a47a5
│   │       │       ├── f1a91e9e24290748d2287086b5ddcf3a
│   │       │       ├── f3f6aa5ade2c7367bef68169d786f3e5
│   │       │       ├── f7cbd26ba1d28d48de824f0e94586655
│   │       │       ├── fb7d8bb50347f4edae6b56ca4bdf07b7
│   │       │       ├── ff3ac92fb50d6f3df410a72f680979c1
│   │       │       └── ffd7643b7c429e23bdb2281097a5e096
│   │       └── production
│   │           ├── sass
│   │           │   └── 8b09e0f86ea12ee8290180fbc9a39608912a0659
│   │           │       ├── scaffolds.css.scssc
│   │           │       ├── tags.css.scssc
│   │           │       └── welcome.css.scssc
│   │           └── sprockets
│   │               ├── 053228ae14696eb3ddaf69e94d9fd5ce
│   │               ├── 0cd10c83ff059a2f4b69b59b8d0abccd
│   │               ├── 10fcfbe6ebae11a40c8eac41939a1b9a
│   │               ├── 13fe41fee1fe35b49d145bcc06610705
│   │               ├── 15c5ee4c79cbf0cb594aecaad8558324
│   │               ├── 220ac4424b82b400ec47fe0570c5aa7f
│   │               ├── 2211190fb757d05874e2b25fc37a31ad
│   │               ├── 2f2229c70dcf195564d4d0fd6a12ac1a
│   │               ├── 2f5173deea6c795b8fdde723bb4b63af
│   │               ├── 357970feca3ac29060c1e3861e2c0953
│   │               ├── 381c3fb00e2c26626c05caaecf1486a7
│   │               ├── 3fc891487990163819656e9afd02e551
│   │               ├── 45124d5a7a9b96db119f6165e046eafc
│   │               ├── 56e9c68d1d8f2475f9b080148503ec36
│   │               ├── 64e51b49f238ea58dc5100d1a46bffc1
│   │               ├── 687381e944802a1959f44214098706b3
│   │               ├── 69021c0e9ed98d6dcf40cffab5fc972d
│   │               ├── 696b212ad3e7ab9a0177e752628d5969
│   │               ├── 6a977b85c07b470831923de1aca7a0c4
│   │               ├── 75ea20b361b20f36734b5fa29c8aedcc
│   │               ├── 86042d3480d349fd4b8a53aa0147c118
│   │               ├── 93708cb34051f3000884905e8669d74a
│   │               ├── 9be6a82e473af59ae2340c17a2dde91a
│   │               ├── a6d4fade9aac0bf5f14d1fa76e77168a
│   │               ├── ad211ce30bd1790a018501b6923f2322
│   │               ├── b01377759f7d414381eafa837b2cdca0
│   │               ├── bcd83911af97bc5f2f9de4aa499ff146
│   │               ├── bd3936370d0f952ada5774e2230046ed
│   │               ├── bd71546009ab5e606b3f27b4c6a79856
│   │               ├── c8870bbe1cf0d62508a60ea5da10c1cf
│   │               ├── cffd775d018f68ce5dba1ee0d951a994
│   │               ├── d771ace226fc8215a3572e0aa35bb0d6
│   │               ├── ea7ac69765f47d6189ed8644f4ebefdd
│   │               ├── ef8d5c64086767d170b6aae6bbca27e7
│   │               ├── f1106c076867a3a612534353347a47a5
│   │               ├── f3f6aa5ade2c7367bef68169d786f3e5
│   │               ├── f7cbd26ba1d28d48de824f0e94586655
│   │               └── ff3ac92fb50d6f3df410a72f680979c1
│   ├── pids
│   ├── sessions
│   └── sockets
└── vendor
    └── assets
        ├── javascripts
        └── stylesheets

55 directories, 194 files

修改:我刚刚注意到Heroku和我在同一个Seperator.png目录中的两个文件(Glyphicons-66-Tag.pngimages 加载当地的发展环境。所有这些文件都有644个属性。

0 个答案:

没有答案
相关问题