Rails 3.2.11在浏览器中加载页面时,JavaScript资源陷入循环



当我在本地安装rails项目(rails s)并查看日志文件时,我最初可以看到我的javascript资产加载得很好

Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2013-02-04 09:46:56 -0600
Served asset /jquery.js - 304 Not Modified (26ms)

但由于某种原因,资产开始尝试重新加载,这是重新加载时的输出:

Started GET "/assets/jquery.js?body=1&_=1359992817255" for 127.0.0.1 at 2013-02-04 09:46:57 -0600
Served asset /jquery.js - 200 OK (0ms)

我搞不清楚,而且我的应用程序中没有任何更改导致了这种情况。还有人遇到这个问题吗?

此外,这是我的GemFile:

source 'https://rubygems.org'
gem 'rails', '3.2.11'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
gem 'devise'
gem 'omniauth', '1.1.0'
gem 'omniauth-oauth2', '1.0.1'
gem 'carrierwave'
gem 'fog'
gem 'mini_magick' #need to install imagemagick for this to work
gem 'therubyracer'
gem 'execjs'
gem 'activeadmin'
gem 'meta_search', '>= 1.1.0.pre'
gem 'awesome_print'
gem 'aws-s3', :require => 'aws/s3'
gem "friendly_id", "~> 4.0.1"
gem 'feedzirra'
gem 'rabl'
gem 'bigdecimal'
gem 'rails_autolink'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
    gem "bootstrap-sass", '~> 2.0.4.0'
  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platform => :ruby
  gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# Use unicorn as the app server
# gem 'unicorn'
gem 'thin'
# Deploy with Capistrano
gem 'capistrano'
gem "typhoeus"
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
gem "gibbon"
group :development, :test do 
  gem "rspec-rails", ">= 2.5.0"
  gem "capybara", ">= 0.4.1.2"
  gem "launchy", ">= 0.4.0"
  gem "database_cleaner", ">= 0.6.7"
  gem "factory_girl_rails", ">= 1.2"
  gem 'spork-rails'
  gem 'guard-rspec'
  gem 'guard-spork'
  gem 'guard-livereload'
  gem 'growl'
  group :darwin do
    gem 'rb-fsevent', :require => false
  end
end
group :test do
  gem "cucumber-rails", ">= 0.4.1"
end

这个问题是在我更新到最新的Rails 之后开始的

解决方案是,这最终是一个糟糕的jQuery正则表达式。

相关内容

  • 没有找到相关文章

最新更新