3

在本地,当我建立我的 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 后开始的

4

1 回答 1

0

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

于 2013-02-04T21:26:18.420 回答