【问题标题】:bundle install error because of therubyracer gem由于rubyracer gem,捆绑安装错误
【发布时间】:2014-11-08 05:42:53
【问题描述】:

我正在使用 rails 4.1.4 和 ruby​​-2.1.1。我的宝石文件:

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。

【问题讨论】:

  • 我认为你不需要那个参数

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


【解决方案1】:

试试这个:

gem 'therubyracer', :platform => :ruby 

【讨论】:

  • 现在新错误显示“/usr/lib/ruby/1.8/fileutils.rb:243:in `mkdir': Permission denied - /var/lib/gems (Errno::EACCES)”
  • 以管理员权限运行 run sudo bundle install
  • 不要与 sudo 捆绑安装。
【解决方案2】:

我从您的错误回溯中看到,您已安装 Ruby 1.8(操作系统默认)。 Ruby on Rails 4.1 至少需要 Ruby 1.9.3。所以你可以使用RVM 来安装更新的 Ruby 版本。然后,您将能够安装所有必需的 gem。现在推荐使用 RVM 或 rbenv 来管理 rubies。

【讨论】:

    猜你喜欢
    • 2012-11-29
    • 2018-10-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-17
    • 1970-01-01
    • 1970-01-01
    • 2011-12-01
    相关资源
    最近更新 更多