2

全新安装 rails 3.2.8 并在添加Mercury后编译时出错:

SyntaxError: cannot return a value from a constructor: "this.element" in class Button
 (in /home/*********/**************/vendor/bundle/ruby/1.8/bundler/gems/mercury-0c048033cd79/app/assets/javascripts/mercury/toolbar.button.js.coffee)

我已经使用 Rails 3.2.3 成功安装了 Mercury,但无法弄清楚为什么这不起作用。

有任何想法吗?

source 'https://rubygems.org'

gem 'rails', '3.2.8'

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

gem 'mysql2'
gem 'bootstrap-sass'
gem 'simple_form'
gem 'json'
gem 'ckeditor'
gem 'mercury-rails', :git => 'https://github.com/jejacks0n/mercury.git'


gem 'jquery-rails'
# gem 'jquery-ui-rails'

gem "paperclip", "~> 2.7"

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

# 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', '0.10.2', :platforms => :ruby
    gem 'libv8', '~> 3.3.10'
    gem 'execjs'
  gem 'uglifier', '>= 1.0.3'
end
4

3 回答 3

2

https://github.com/jejacks0n/mercury/issues/349

我想你需要锁定到 coffeescript 1.4.0

这解决了我的问题。

于 2013-02-28T19:12:46.777 回答
1

显然,有一个修复,它在github repo中,但还没有在 ruby​​gems 上。如果您不想降级咖啡脚本,只需在 Gemfile 中指定存储库:

# Gemfile
# ...
gem 'mercury-rails', git: 'git://github.com/jejacks0n/mercury'

然后运行bundle update mercury-rails。这为我解决了这个问题,而无需降级咖啡脚本。

于 2013-04-09T20:36:29.063 回答
0

Here's what you actually need to type into your gemfile:

gem 'coffee-script-source', '1.4.0'
于 2013-03-14T20:54:31.567 回答