Therubyracer bug on heroku as "Failed to set gems through the bundler."

When I click my application on the hero, he gives me the 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 installed it again, but still gives me the same error. I also tried bundle install --without development:test for production, it also gives me the 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
source share
3 answers

Try running bundle install , than pushing the changes to the remote repo.

Also, if you use therubyracer compilation for assets, you can pre-copy the resources locally and read these documents: https://devcenter.heroku.com/articles/rails-asset-pipeline#compiling-assets-locally https: // devcenter. heroku.com/articles/rails-asset-pipeline#therubyracer

+1
source

therubyracer gem is used to evaluate JavaScript from within Ruby (it embeds a JavaScript interpreter in Ruby).

This stone is necessary if you are running Ubuntu, as there is no Javascript runtime in ubuntu.

But this is not the case with Heroku .

So, just keep the line for therubyracer gem in the Gemfile in the development group, as shown below:

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

According to Heroku Docs :

If you previously used therubyracer or therubyracer-heroku, these gems are no longer needed, but very discouraged , because these gems use a very large amount of memory.

As a replacement on Ubuntu, you can install NodeJS:

 sudo apt-get install nodejs 
0
source

Source: https://habr.com/ru/post/1483016/


All Articles