2013-05-27 104 views
4

當我把我的應用程序的Heroku它給了我下面的錯誤heroku上的therubyracer錯誤爲「無法通過Bundler安裝寶石」。

-----> 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 

我刪除了我Gemlock文件並重新捆綁安裝,但仍然給了我同樣的錯誤。我也試過bundle install --without development:test生產它也給我同樣的錯誤我能做什麼。這裏是我的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' 
+0

什麼OS是你 – David

+0

我使用Ubuntu 12.04 – Shrikant1712

回答

0

therubyracer寶石是用來評估JavaScriptRuby(它嵌入JavaScript解釋爲紅寶石) 。

這個寶石是必需的,如果你是在Ubuntu中開發的,ubuntu沒有Javascript runtime

但是它沒有與Heroku的情況。

所以,只要保持線爲Gemfiledevelopmenttherubyracer寶石如下所示:

group :development do 
    gem 'therubyracer', '0.10.2', :platforms => :ruby 
end 
0

根據Heroku docs

如果您以前使用therubyracer或therubyracer-的Heroku ,這些寶石不再需要,並且強烈不鼓勵,因爲這些寶石使用了大量的內存。

由於在Ubuntu的替代,您可以安裝的NodeJS:

sudo apt-get install nodejs