当我将我的应用程序推送到 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'

最佳答案

尝试运行 bundle install 而不是将更改推送到远程仓库。

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

10-08 04:23