由于therubyracer gem而捆绑安装错误

时间:2014-11-08 05:42:53

标签: ruby-on-rails ruby-on-rails-4 bundle

我正在使用rails 4.1.4和ruby-2.1.1。我的Gemfile:

source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.4'
# Use mysql as the database for Active Record
gem 'mysql2'

gem 'devise'
gem "paperclip", "~> 4.2"
gem 'aws-sdk'

gem 'bootstrap-sass-rails'
gem 'bootstrap-datepicker-rails'

gem 'jquery-tokeninput-rails'

gem 'carmen-rails'

gem 'will_paginate'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer',  platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'jquery-ui-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0',          group: :doc

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring',        group: :development

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

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

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Use debugger
gem 'byebug'
# gem 'debugger', group: [:development, :test]

# group :production do
#   gem "rails_12factor"
#   gem "activerecord-postgresql-adapter"
#   gem 'pg'
# end

gem 'activemerchant'

但每当我运行bundle install命令 Rubymine 时,

Gemfile:29: syntax error, unexpected ':', expecting $end
gem 'therubyracer',  platforms: :ruby

我该怎么办?如果我评论出“therubyracer”宝石。然后,此错误显示sdoc gem。

2 个答案:

答案 0 :(得分:1)

试试这个:

gem 'therubyracer', :platform => :ruby 

答案 1 :(得分:0)

正如我从错误回溯中看到的那样,您安装了Ruby 1.8(操作系统默认值)。 Ruby on Rails 4.1至少需要Ruby 1.9.3。因此,您可以使用RVM来安装较新的Ruby版本。然后你就可以安装所有必需的宝石了。现在推荐使用RVM或rbenv来管理红宝石。