Rails 3.2 js未在生产中加载

时间:2019-07-12 05:03:08

标签: ruby-on-rails

我正在从Rails 3.2的备份中还原应用程序。该应用程序正在使用带有自定义模板的spree。

在开发中,它工作正常,但在生产中,控制台中出现js错误:

  

未捕获的TypeError:$(...)。slides不是函数

所有JavaScript都中断了。

我尝试了所有可能的修复方法,例如清理并重新编译资产或更新捆绑软件。

production.rb

# Code is not reloaded between requests
  config.cache_classes = true

  # Full error reports are disabled and caching is turned on
  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true

  # Disable Rails's static asset server (Apache or nginx will already do this)
  config.serve_static_assets = true

  # Compress JavaScripts and CSS
  config.assets.compress = true

  # Don't fallback to assets pipeline if a precompiled asset is missed
  config.assets.compile = true

  # Generate digests for assets URLs
  config.assets.digest = false

关于Gemfile,我拥有的其他东西

gem 'jquery-rails'

    # Gems used only for assets and not required
    # in production environments by default.

        gem 'sass', '3.2.7'
        group :assets do
          gem 'sass-rails',   '~> 3.2.6'
          gem 'coffee-rails', '~> 3.2.1'
         # See https://github.com/sstephenson/execjs#readme for more supported runtimes
          gem 'therubyracer', :platforms => :ruby
          gem 'execjs'
          gem 'uglifier', '>= 1.0.3'
        end

关于我可以看的地方有什么建议吗?

1 个答案:

答案 0 :(得分:0)

看看是什么.slides错误,在我脑海中浮出水面的可能是丢失的jquery插件,您将它插入了vendor / js /并在管道中需要。