简体   繁体   中英

Mercury Editor complains about jquery 1.7 on Heroku

I have an app that works great in development, but when I push it to Heroku, Mercury Editor doesn't work. This is what the browser reports:

GET http://domain.com/javascripts/jquery-1.7.js 404 (Not Found)

and then of course:

Uncaught ReferenceError: $ is not defined       mercury-b3d36be256f77d3d2190b11910f92c7e.js:1
(anonymous function)
Uncaught TypeError: undefined is not a function
(anonymous function)

Sources pane of Chrome console:

<title>Mercury Editor</title>
<link href="/assets/mercury-1c5e058864b28582ab79e4fb2519dceb.css" media="screen" rel="stylesheet" />
<script src="/javascripts/jquery-1.7.js"></script>
<script src="/assets/mercury-b3d36be256f77d3d2190b11910f92c7e.js"></script>

My gemfile :

source 'https://rubygems.org'
ruby '2.1.1'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.3'
gem 'bootstrap-sass', '~> 3.1.1'
gem 'bcrypt-ruby', '3.1.2'
gem 'faker', '1.1.2'
gem 'will_paginate', '3.0.4'
gem 'bootstrap-will_paginate', '0.0.9'
gem 'mercury-rails', git: 'https://github.com/jejacks0n/mercury.git'
gem 'jquery-migrate-rails'
gem 'friendly_id', '~> 5.0.0'
gem 'paperclip'
gem 'aws-sdk'
gem 'rmagick', '2.13.2'
gem 'figaro'

# Use sqlite3 as the database for Active Record
group :development do
    gem 'sqlite3', '1.3.8'
    gem 'rspec-rails', '2.13.1'
end

group :test do
    gem 'selenium-webdriver', '2.35.1'
    gem 'capybara', '2.1.0'
    gem 'factory_girl_rails', '4.2.1'
end


# Use SCSS for stylesheets
gem 'sass-rails', '4.0.1'

gem 'sprockets', '2.11.0'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '2.1.1'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '4.0.1'

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

# Use jquery as the JavaScript library
gem 'jquery-rails', '3.0.4'

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks', '1.1.1'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '1.0.2'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', '0.3.20', require: false
end

group :production do
    gem 'pg', '0.15.1'
    gem 'rails_12factor', '0.0.2'
end

application.js :

//= require jquery
//= require jquery_ujs
//= require jquery-migrate-min
//= require turbolinks
//= require bootstrap.min
//= require_tree .

I don't know what loads jquery 1.7, but I think it might be a dependency of Mercury Editor because I had to install jquery-migrate-rails for it. I don't know why it works in development and not on Heroku though. It seems like it is not included with the asset pipeline.

I ended up switching to CKEditor , which (unlike mercury-rails) is still being maintained. The transition was quite seamless.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM