【问题标题】:jquery in Rails 3.1.1 always gives DOMExceptionRails 3.1.1 中的 jquery 总是给出 DOMException
【发布时间】:2012-08-08 22:13:49
【问题描述】:

我创建了一个新应用

rails new toy
cd toy
bundle install
rails generate controller start
rm public/index.html

app/views/start/index.html.erb 包含:

Hi

app/controllers/start_controller.rb 包含:

class StartController < ApplicationController
  def index
  end
end

config/routes.rb 是:

Toy::Application.routes.draw do
  root :to => 'start#index'
end

如果我运行它并单击页面上的任意位置,我会在调试器中收到错误:

这发生在我运行的每个应用程序上。

这是默认的 Gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.3'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'


# 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'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platform => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

【问题讨论】:

  • 也许您应该尝试升级到 Rails 3.1.7? (如果 Rails 3.2.x 不在,那就是)
  • @BenjaminTan,在搞了一整天 rvm 之后,问题仍然存在于 Rails 3.1.7

标签: javascript jquery ruby-on-rails ruby-on-rails-3 debugging


【解决方案1】:

我能够复制这个。在this commit 中修复它。

【讨论】:

    猜你喜欢
    • 2023-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多