2

捆绑安装我的更新时收到错误消息。这是我的宝石文件:

source 'https://rubygems.org'

gem 'rails', '3.2.1'

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

gem 'mysql2'
gem 'libv8'
gem 'therubyracer'
gem 'haml'
gem 'haml-rails'
gem 'sass-rails',   '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'compass-rails'
gem 'chosen-rails'
gem "bootstrap-wysihtml5-rails", "~> 0.3.1.10"
gem 'hpricot'
gem "rest-open-uri", "~> 1.0.0"
gem 'jquery-datatables-rails', github: 'rweng/jquery-datatables-rails'

# Gems used only for assets and not required
# in production environments by default.
group :assets do

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer'

  gem 'uglifier', '>= 1.0.3'
  gem "commonjs", "~> 0.2.6"
  gem "less", "~> 2.2.2"
  gem "less-rails", "~> 2.2.6"
end


gem 'jquery-rails'
gem 'simple_form'
gem 'client_side_validations'
gem 'client_side_validations-simple_form'

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

这是我在生产中运行 bundle install 命令后遇到的错误:

安装 ruby​​racer (0.11.0) 时出错,Bundler 无法继续。gem install therubyracer -v '0.11.0' 在捆绑之前确保成功。

4

5 回答 5

8

我做了以下对我有用的事情:

  • 我从我的 Gemfile 中注释掉了 therubyracer
  • 运行“捆绑安装”
  • 使用“gem install therubyracer”安装了最新版本的 therubyracer(在撰写本文时为 0.11.2)
  • 我取消注释 therubyracer 以将其放回我的 Gemfile
  • 再次运行“捆绑安装”,一切正常
于 2013-01-12T00:36:04.167 回答
4

包括似乎是对此的修复libv8Gemfile

gem 'libv8', '~> 3.11.8.3'

通过https://github.com/cowboyd/therubyracer/issues/215

于 2012-12-13T05:45:06.807 回答
2

我做了一个 gem 卸载 therubyracer 和 gem 卸载 libv8,然后从 gemfile 中删除 libv8 并只使用 therubyracer,然后运行“捆绑安装”

于 2013-01-09T19:24:08.197 回答
1
group :assets do
  gem 'therubyracer'
end

如果它仍然不起作用,只需尝试安装 NodeJS

于 2012-12-09T11:45:59.667 回答
1

可能,您的 libv8 版本和 therubyracer 版本不匹配。

因此,您可以在 Gemfile 中包含正确的 libv8 版本,这类似于 jibiel 的解决方案

gem 'libv8', '~> 3.11.8.3'

但是,我更愿意执行这两个步骤,因此,您不必担心找到合适的 libv8 版本:

Gemfile

gem 'therubyracer'

terminal

gem uninstall libv8
bundle install

而且,这就是我为解决同样的问题所做的

于 2014-01-09T13:00:33.843 回答