heroku上的therubyracer错误为“未能通过Bundler安装宝石”。 [英] therubyracer error on heroku as "Failed to install gems via Bundler."

查看:126
本文介绍了heroku上的therubyracer错误为“未能通过Bundler安装宝石”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将我的应用程序推送到heroku时,它给了我以下错误:

  -----> Ruby / Rails应用程序检测到
----->使用Bundler版本1.3.2安装依赖关系
正在运行:bundle install --without development:test --path vendor / bundle --binstubs vendor / bundle / bin --deployment
您正在尝试在部署中安装改变
你的Gemfile后的模式。在别处运行`bundle install`并将
更新的Gemfile.lock添加到版本控制中。
您已添加到Gemfile中:
* therubyracer

!无法通过Bundler安装宝石。

! Heroku推送被拒绝,未能编译Ruby / Rails应用程序

我删除了我的Gemlock文件并再次安装它但仍然给我同样的错误。我也试过 bundle install --without development:test for production它也给我提供了同样的错误我该怎么做。这是我的Gemfile

  source'https://rubygems.org'

gem'rails' ,'3.2.9'

gem'carrierwave'
gem'newrelic_rpm'

#gemless-rails#Sprockets(Rails 3.1使用的是什么资产管道)支持LESS

#gemtwitter-bootstrap-rails
gem'will_paginate','3.0.3'
#gem'bootstrap-will_paginate','0.0 .6'
#Bundle edge Rails改为:
#gem'rails',:git => 'git://github.com/rails/rails.git'

#gem'mysql2'
gem'dynamic_form'
gem'therubyracer','0.10.2' ,:platforms => :ruby
gem'devise'
gem'hirb'

#用于Facebook的宝石
gem'facebook_oauth'
gem'oauth','0.4 .7'
gem'will_paginate','3.0.3'
gem'bootstrap-will_paginate','0.0.6'
gem'thin'
gem'pg'
#Gems仅用于资产,默认情况下不需要生产环境中的
#。
group:assets do
#gem'sass-rails','〜> 3.2.3'
gem'咖啡栏','〜> 3.2.1'

#请参阅https://github.com/sstephenson/execjs#readme了解更多支持的运行时间

gem'uglifier','> = 1.0。 3'
end

gem'jquery-rails'


解决方案

尝试运行 bundle install 比推送更改为远程回购。

另外,如果您使用therubyracer进行资产编译,您可以在本地预编译资产并阅读此文档:
https://devcenter.heroku.com/articles/rails-asset-pipeline#compiling-assets-locally
https://devcenter.heroku.com/articles/rails-asset -pipeline#therubyracer


When i push my app to heroku it gives me following error

-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.3.2
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
       You are trying to install in deployment mode after changing
       your Gemfile. Run `bundle install` elsewhere and add the
       updated Gemfile.lock to version control.
       You have added to the Gemfile:
       * therubyracer
 !
 !     Failed to install gems via Bundler.
 !
 !     Heroku push rejected, failed to compile Ruby/Rails app

I deleted my Gemlock file and again bundle install it but still gives me same error. I also tried bundle install --without development:test for production it also gives me same error What can I do. Here is my Gemfile

source 'https://rubygems.org'

gem 'rails', '3.2.9'

gem 'carrierwave'
gem 'newrelic_rpm'

#gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS

#gem "twitter-bootstrap-rails"
gem 'will_paginate', '3.0.3'
#gem 'bootstrap-will_paginate', '0.0.6'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

#gem 'mysql2'
gem 'dynamic_form'
gem 'therubyracer', '0.10.2', :platforms => :ruby
gem 'devise'
gem 'hirb'

# Gems used for Facebook
gem 'facebook_oauth'
gem 'oauth','0.4.7'
gem 'will_paginate', '3.0.3'
gem 'bootstrap-will_paginate', '0.0.6'
gem 'thin'
gem 'pg'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
  #gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

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

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

解决方案

Try run bundle install than push changes to remote repo.

Also if you use therubyracer for assets compilation, you may precompile assets locally and read this docs: https://devcenter.heroku.com/articles/rails-asset-pipeline#compiling-assets-locally https://devcenter.heroku.com/articles/rails-asset-pipeline#therubyracer

这篇关于heroku上的therubyracer错误为“未能通过Bundler安装宝石”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆