Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to completely remove webpack and all its dependencies from Rails App

I created my rails with this template that included webpack, I still write my javascript code in app/assets/javascript. I am trying to deploy my app to heroku and it keeps failing, I get this error

"remote:
/tmp/build_6f0656280cbbda40c5832ccb79fc1783/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/rubygems_integration.rb:432:in `block in replace_bin_path': can't find executable webpack for gem webpacker (Gem::Exception)"

I have tried lots of solutions but still cant get my app deployed to Heroku. I want to know how to completely delete webpack and all its depencies from my app since it was not even useful to my app

    source 'https://rubygems.org'
ruby '2.3.5'

gem 'figaro'
gem 'jbuilder', '~> 2.0'
gem 'puma'
gem 'rails', '5.1.4'
gem 'redis'
gem 'cloudinary'
gem 'carrierwave', '~> 1.2'
gem 'rails_admin', '~> 1.2'
group :production do
 gem 'pg', '~> 0.20'
end



gem 'autoprefixer-rails'
gem 'bootstrap-sass'
gem 'jquery-rails'
gem 'font-awesome-sass'
gem 'sass-rails'
gem 'simple_form'
gem 'turbolinks', '~> 5.0.0'
gem 'coffee-rails'

gem 'uglifier'
gem 'webpacker'
gem 'devise'
gem 'ransack'
gem 'trix'


gem "letter_opener", group: :development


group :development do
  gem 'web-console', '>= 3.3.0'
  gem 'sqlite3'
end

group :development, :test do
  # gem 'binding_of_caller'
  # gem 'better_errors'
  gem 'pry-byebug'
  gem 'pry-rails'
  gem 'listen', '~> 3.0.5'
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end
like image 710
Hakeem Baba Avatar asked Mar 05 '18 10:03

Hakeem Baba


1 Answers

  • remove bin/webpackor run bundle exec rake rails:update:bin
  • remove config/webpacker.yml
  • remove config/webpack
  • remove app/javascripts
  • remove config.webpacker.check_yarn_integrity = false from config/{development, test, production}.rb
  • verify that you don't have webpacker in your gemfile and run bundle install or bundle clean

imho, don't create your rails app with generators (unless it's your own)

like image 74
Ben Avatar answered Oct 21 '22 20:10

Ben