Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/20.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 赫罗库';服务于静态资产';问题_Ruby_Ruby On Rails 4_Heroku - Fatal编程技术网

Ruby 赫罗库';服务于静态资产';问题

Ruby 赫罗库';服务于静态资产';问题,ruby,ruby-on-rails-4,heroku,Ruby,Ruby On Rails 4,Heroku,我在推heroku时遇到了麻烦;我不断得到: DEPRECATION WARNING: The configuration option `config.serve_static_assets` has been renamed to `config.serve_static_files` to clarify its role (it merely enables serving everything in the `public` folder and is unrelated to the

我在推heroku时遇到了麻烦;我不断得到:

DEPRECATION WARNING: The configuration option `config.serve_static_assets` has been renamed to `config.serve_static_files` to clarify its role (it merely enables serving everything in the `public` folder and is unrelated to the asset pipeline). The `serve_static_assets` alias will be removed in Rails 5.0. Please migrate your configuration files accordingly. (called from block in tsort_each at /app/vendor/ruby-2.1.6/lib/ruby/2.1.0/tsort.rb:226)
(也就是刚才看到的这个):

现在我读了一些东西,比如,我已经搜索了我的应用程序,但没有设置它;但是,在my Gemfile.lock中:

rails_serve_static_assets
219导轨标准件记录 220:rails服务静态资产(0.0.2)

这可能是问题所在吗?现在在我的production.rb中,是否应该删除.lock和bundle安装:

config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?

不知道我是否应该升级到2.2.2:patchlevel 95,Rubygems:;2.4.5

你的应用程序/config/environments/production.rb
下的
Rails.application.configure do
添加以下内容:

config.serve_static_files = true

如果在一个配置文件中找不到
service\u static\u assets
,则可能是某个gem(可能是rails\u service\u static\u assets)正在设置此选项。那么就这样做吧:

bundle update rails_serve_static_assets
或一般而言:

bundle update 
第二个会更新你所有的宝石。
它解决了我的问题

但我已经有config.service\u static\u files=ENV['RAILS\u service\u static\u files']。现在有吗?在heroku配置变量中,它们会自动添加RAILS\u SERVE\u STATIC\u FILES=>enabled;那不是一回事吗?
bundle update