4

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

3 回答 3

1

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

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

于 2013-05-27T19:33:31.753 回答
0

therubyracergem 用于JavaScript从内部进行评估Ruby(它将 JavaScript 解释器嵌入到 Ruby 中)。

这个 gem 是必需的,如果你在 Ubuntu 中开发,因为 ubuntu 没有Javascript runtime.

但情况并非如此Heroku

因此,只需将therubyracergem保留Gemfile在下development组中,如下所示:

group :development do
  gem 'therubyracer', '0.10.2', :platforms => :ruby
end
于 2013-05-28T06:06:10.787 回答
0

根据Heroku 文档

如果您之前使用的是 therubyracer 或 therubyracer-heroku,则不再需要这些 gem,并且强烈建议您不要使用这些 gem,因为这些 gem 会占用大量内存。

作为 Ubuntu 上的替代品,您可以安装 NodeJS:

sudo apt-get install nodejs
于 2013-10-31T04:36:13.490 回答