使用webpack将Rails应用程序部署到heroku

时间:2018-03-04 20:24:08

标签: ruby-on-rails ruby heroku webpack webpack-dev-server

我使用包含webpack的this template创建了我的rails。但我仍然在app / assets / javascript中编写了我的javascript代码。现在我正在尝试将我的应用程序部署到heroku并且它一直在失败。我收到此错误

  

remote:/tmp/build_6f0656280cbbda40c5832ccb79fc1783/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/rubygems_integration.rb:432:inclock in replace_bin_path':找不到可执行文件用于gem webpacker的webpack(Gem :: Exception)

主要错误似乎是“无法找到gem webpacker的可执行webpack”。我不知道如何解决它。这是我的宝石文件

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

1 个答案:

答案 0 :(得分:2)

突破3.3.0的变化

https://github.com/rails/webpacker/blob/master/CHANGELOG.md#330---2018-03-03

bundle exec rails webpacker:binstubs