【问题标题】:Rails Assets: expected ')' got '}' - Command failed with status (1)Rails 资产:预期的 ')' 得到 '}' - 命令失败,状态为 (1)
【发布时间】:2013-04-16 16:54:53
【问题描述】:

我最近开始在我的资产管道中遇到奇怪的行为。我正在使用 Ruby on Rails (3.2.3)。我正在使用的著名库:

# From Gemfile
gem 'jquery-rails'
gem 'therubyracer', :require => 'v8'
gem "less-rails"
gem 'twitter-bootstrap-rails', '>= 2.1.6'
gem 'sass-rails', '~> 3.2.3'
gem 'devise', '~> 2.2.3'        #   Note: Recently upgraded

我最近去编译我的资产并且碰到了这堵墙:

$ bundle exec rake assets:precompile RAILS_ENV=development --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/Users/tim/.rvm/rubies/ruby-1.9.3-p374/bin/ruby /Users/tim/.rvm/gems/ruby-1.9.3-p374/bin/rake assets:precompile:all RAILS_ENV=development RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
expected ')' got '}'
Command failed with status (1): [/Users/tim/.rvm/rubies/ruby-1.9.3-p374/bin...]

在过去的几个小时里,我一直在研究这个问题,试图找到关于这个问题发生在哪里的线索。在这一点上,我的主要问题是我从 rails 得到的反馈/错误输出。通过跟踪,我仍在查看我的许多资产文件/目录之一中似乎存在的问题。编译期间的其他调试或文件跟踪方法(可能是更详细的编译模式?)此时会很好。

我的下一步是查看我的 Git 提交日志,查看资产管道的哪些更改可能导致此问题。

【问题讨论】:

  • 我建议检查您的自定义资产是否有错误输入的括号。我不会那么难扫描你的js和样式表中的代码。应用程序在开发模式下是否正常运行?

标签: ruby-on-rails debugging less asset-pipeline twitter-bootstrap-rails


【解决方案1】:

这是 twitter bootstrap gem 中的错误。错误的 css 语法。尝试从清单文件 application.css 中删除它并重新启动资产预编译。如果它真的引导 gem 尝试使用最新版本

【讨论】:

    猜你喜欢
    • 2015-08-12
    • 2013-02-06
    • 2012-12-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多