相同的来源,不同的环境。为什么不能读同样的js?

时间:2017-02-19 09:20:13

标签: javascript ruby-on-rails asset-pipeline

我正在制作Rails应用。 尽管有相同的程序源,但在本地pc和分段之间似乎有不同的js读数。

这是结果。

Staging

Local

SourceCode是这样的。 配置/初始化/ assets.rb

# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# Rails.application.config.assets.precompile += %w( search.js )
Rails.application.config.assets.precompile += %w( flatly.css )
Rails.application.config.assets.precompile += %w( flatly.js )
Rails.application.config.assets.precompile += %w( application.css )
Rails.application.config.assets.precompile += %w( frontpage.css )
Rails.application.config.assets.precompile += %w( frontpage.js )
Rails.application.config.assets.precompile += %w( restaurant.css )
Rails.application.config.assets.precompile += %w( restaurant_type.css )
Rails.application.config.assets.precompile += %w( shop.css )
Rails.application.config.assets.precompile += %w( search.css )
Rails.application.config.assets.precompile += %w( area.css )
Rails.application.config.assets.precompile += %w( menu.css )
Rails.application.config.assets.precompile += %w( product.css )
Rails.application.config.assets.precompile += %w( slick.css )
Rails.application.config.assets.precompile += %w( cuisine.css )
Rails.application.config.assets.precompile += %w( prefstate.css )
Rails.application.config.assets.precompile += %w( about_us.css )
Rails.application.config.assets.precompile += %w( terms.css )
Rails.application.config.assets.precompile += %w( privacy.css )
Rails.application.config.assets.precompile += %w( devise/sessions.css )
Rails.application.config.assets.precompile += %w( devise/registrations.css )
Rails.application.config.assets.precompile += %w( knowledge_sprouts.js )
Rails.application.config.assets.precompile += %w( knowledge_sprouts.css )
Rails.application.config.assets.precompile += %w( users.css )
Rails.application.config.assets.precompile += %w( users/registrations.css )
Rails.application.config.assets.precompile += %w( jquery.tagit.css )
Rails.application.config.assets.precompile += %w( tag-it.js )

还有这里的application.js /app/assets/javascripts/application.js

//= require jquery
//= require jquery-ui
//= require tag-it
//= require bootstrap
//= require gmaps/google
//= require ahoy
//= require underscore
//= require knowledge_sprout

LocalPC和Staging完全相同,除了对环境有价值。 有什么问题?有什么想法吗?

[附录]

Rails -v

  

Rails 4.2.3(两者都是)

Ruby -v

  

(local)ruby 2.3.0p0(2015-12-25修订版53290)[x86_64-darwin15]   (分期)ruby 2.3.1p112(2016-04-26修订版54768)[x86_64-linux]

0 个答案:

没有答案