Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 5.2 on Heroku - missing coffee_script

I have been using Rails 5.2 from the 5-2-stable branch of Rails to use ActiveStorage, now I am updating a bunch of apps to use the released version again. As mentioned in this issue the rails versions from Github all requires coffee_script. Now I want to remove coffee.

I cannot recreate this in my local environment or on CI, but when deploying to Heroku it fails with:

LoadError: cannot load such file -- coffee_script
       /tmp/build_2b0eaffa6f7fd662e3233ac5b4de6d62/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'

I cannot find any mention of coffee in my code.

Could this be a caching issue on Herkou or similar? Any clues are welcome.

Failing gemfile

https://github.com/fsek/voting/blob/50d063d16ae8d323f0cfe57e5bb6b4299c592019/Gemfile

Working gemfile (separate project, can be deployed)

https://github.com/pensionsupplysning/web/blob/cb256668640e38af4b59e8cf23fbfa939728abb7/Gemfile

like image 970
davidwessman Avatar asked Apr 16 '18 19:04

davidwessman


People also ask

What is Ruby on rails 5 on Heroku?

Ruby on Rails is a popular web framework written in Ruby. This guide covers using Rails 5 on Heroku. For information on running previous versions of Rails on Heroku, see the tutorial for Rails 4.x or Rails 3.x. For this guide you will need:

Can I deploy my first rails 5 application to Heroku?

You have deployed your first Rails 5 application to Heroku. Here’s some recommended reading: Visit the Ruby support category to learn more about using Ruby and Rails on Heroku. The Deployment category provides a variety of powerful integrations and features to help streamline and simplify your deployments.

How do I use CoffeeScript with rails?

CoffeeScript adapter for the Rails asset pipeline. Also adds support to use CoffeeScript to respond to JavaScript requests (use .coffee views). Since Rails 3.1 Coffee-Rails is included in the default Gemfile when you create a new application. If you are upgrading to Rails 3.1 you must add the coffee-rails to your Gemfile:

How to use Puma in rails 5 with Heroku?

Another useful command for debugging is $ heroku run bash which will spin up a new dyno and give you access to a bash session. By default, your app’s web process runs rails server, which uses Puma in Rails 5. If you are upgrading an app you’ll need to add puma to your application Gemfile: Now you are ready to configure your app to use Puma.


1 Answers

Add the gem coffee-rails to your project or migrate to sprockets 4.x and make sure you follow this migration guide: https://github.com/rails/sprockets/blob/master/UPGRADING.md#manifestjs

like image 92
Paulo Fidalgo Avatar answered Sep 21 '22 20:09

Paulo Fidalgo