当我将我的应用程序推送到heroku时,它会出现以下错误
-----> 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 :(得分:1)
尝试运行bundle install
而不是将更改推送到远程仓库。
此外,如果您使用therubyracer进行资产编译,您可以在本地预编译资产并阅读此文档: https://devcenter.heroku.com/articles/rails-asset-pipeline#compiling-assets-locally https://devcenter.heroku.com/articles/rails-asset-pipeline#therubyracer
答案 1 :(得分:0)
therubyracer
gem用于评估JavaScript
内的Ruby
(它将JavaScript解释器嵌入到Ruby中)。
这个gem是必需的,如果你在Ubuntu中开发,那么ubuntu没有Javascript runtime
。
但Heroku
并非如此。
所以,只需在therubyracer
组Gemfile
下保留development
gem的行,如下所示:
group :development do
gem 'therubyracer', '0.10.2', :platforms => :ruby
end