【问题标题】:Setting up Sass using Ruby on Rails使用 Ruby on Rails 设置 Sass
【发布时间】:2014-10-22 05:38:49
【问题描述】:

我的 Windows 机器上安装了 sass、compass、bundler、ruby 和 rails。

我一直按照https://github.com/twbs/bootstrap-sass的步骤进行操作

一个。 Ruby on Rails

我已经在 Gemfile 中添加了宝石...

source 'https://rubygems.org'

gemspec

# Compass for the dummy app
gem 'compass', require: false

group :development do
  gem 'byebug', platform: :mri_21, require: false
end

# Adding bootstrap gem
gem 'bootstrap-sass', '~> 3.2.0'
gem 'sass-rails', '>= 3.2'
gem 'autoprefixer-rails'

当我运行 bundle install 命令时,我收到:

➤  bundle install

Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Gemfile syntax error compile error
on line 6: syntax error, unexpected ':', expecting $end
gem 'compass', require: false

                   ^

我该如何解决这个问题?

【问题讨论】:

  • 你的 ruby​​ 版本是什么?试试 :require => false
  • 我的 ruby​​ 版本是 1.8.7,rails 是 3.0.0
  • 有效,但现在第 9 行出现语法错误
  • 做同样的事情 :require => false
  • 我认为这是 1.8.7 的语法问题 ..每当您看到 key: :value 对时..do :key => :value ..您是否遵循相同版本的 ruby​​ 和 rails 的教程??

标签: ruby-on-rails ruby twitter-bootstrap sass


【解决方案1】:

您正在使用新的 key: value 语法,该语法在 Ruby 1.9 中引入。在 Ruby 1.8 中你不能这样做。 Ruby 1.8 is also deprecated,你真的应该停止使用它。你会在死版的语言中学习错误的东西。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-06-24
    • 1970-01-01
    • 1970-01-01
    • 2021-04-05
    • 1970-01-01
    • 2020-06-04
    • 2012-08-21
    相关资源
    最近更新 更多