michaldarda / parcel-rails

Integration of Parcel Javascript module bundler with Rails
MIT License
68 stars 4 forks source link

Gem Load Error is: uninitialized constant Rails::Generators #6

Closed RickCarlino closed 6 years ago

RickCarlino commented 6 years ago

I just installed the gem and followed directions per the README. My parcel.rb looks like this:

Rails.application.config.parcel do |parcel|
  parcel.entry_points = %w(webpack/entry.tsx)
  parcel.destination = 'public/parcels'
end

When I run rails parcel:serve I get this error:

rails aborted!
Bundler::GemRequireError: There was an error while trying to load the gem 'parcel-rails'.
Gem Load Error is: uninitialized constant Rails::Generators
Backtrace for gem load error is:
/whatever/gems/parcel-rails-0.9.2/lib/parcel/rails/parcel_generator.rb:3:in `<top (required)>'
/whatever/gems/parcel-rails-0.9.2/lib/parcel-rails.rb:5:in `<top (required)>'
/whatever/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in `require'
/whatever/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
/whatever/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `each'
/whatever/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `block in require'
/whatever/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `each'
/whatever/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `require'
/whatever/gems/bundler-1.16.1/lib/bundler.rb:114:in `require'
/whatever/api/config/application.rb:8:in `<top (required)>'
/whatever/api/Rakefile:4:in `require'
/whatever/api/Rakefile:4:in `<top (required)>'
/whatever/rake-12.3.0/lib/rake/rake_module.rb:29:in `load'
/whatever/rake-12.3.0/lib/rake/rake_module.rb:29:in `load_rakefile'
/whatever/rake-12.3.0/lib/rake/application.rb:703:in `raw_load_rakefile'
/whatever/rake-12.3.0/lib/rake/application.rb:104:in `block in load_rakefile'
/whatever/rake-12.3.0/lib/rake/application.rb:186:in `standard_exception_handling'
/whatever/rake-12.3.0/lib/rake/application.rb:103:in `load_rakefile'
/whatever/gems/railties-5.1.5/lib/rails/commands/rake/rake_command.rb:20:in `block in perform'
/whatever/rake-12.3.0/lib/rake/application.rb:186:in `standard_exception_handling'
/whatever/gems/railties-5.1.5/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/whatever/gems/railties-5.1.5/lib/rails/command.rb:46:in `invoke'
/whatever/gems/railties-5.1.5/lib/rails/commands.rb:16:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Bundler Error Backtrace:
/whatever/gems/bundler-1.16.1/lib/bundler/runtime.rb:84:in `rescue in block (2 levels) in require'
/whatever/gems/bundler-1.16.1/lib/bundler/runtime.rb:80:in `block (2 levels) in require'
/whatever/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `each'
/whatever/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `block in require'
/whatever/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `each'
/whatever/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `require'
/whatever/gems/bundler-1.16.1/lib/bundler.rb:114:in `require'
/whatever/api/config/application.rb:8:in `<top (required)>'
/whatever/api/Rakefile:4:in `require'
/whatever/api/Rakefile:4:in `<top (required)>'
/whatever/gems/railties-5.1.5/lib/rails/commands/rake/rake_command.rb:20:in `block in perform'
/whatever/gems/railties-5.1.5/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/whatever/gems/railties-5.1.5/lib/rails/command.rb:46:in `invoke'
/whatever/gems/railties-5.1.5/lib/rails/commands.rb:16:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'

Caused by:
NameError: uninitialized constant Rails::Generators
/whatever/gems/parcel-rails-0.9.2/lib/parcel/rails/parcel_generator.rb:3:in `<top (required)>'
/whatever/gems/parcel-rails-0.9.2/lib/parcel-rails.rb:5:in `<top (required)>'
/whatever/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in `require'
/whatever/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
/whatever/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `each'
/whatever/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `block in require'
/whatever/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `each'
/whatever/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `require'
/whatever/gems/bundler-1.16.1/lib/bundler.rb:114:in `require'
/whatever/api/config/application.rb:8:in `<top (required)>'
/whatever/api/Rakefile:4:in `require'
/whatever/api/Rakefile:4:in `<top (required)>'
/whatever/gems/railties-5.1.5/lib/rails/commands/rake/rake_command.rb:20:in `block in perform'
/whatever/gems/railties-5.1.5/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/whatever/gems/railties-5.1.5/lib/rails/command.rb:46:in `invoke'
/whatever/gems/railties-5.1.5/lib/rails/commands.rb:16:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
(See full trace by running task with --trace)
michaldarda commented 6 years ago

@RickCarlino Hello, can you try with a fresh master branch? You must include gem like this in your Gemfile:

gem 'parcel-rails', github: 'michaldarda/parcel-rails'

Also command is parcel:serve, not parcel:server

RickCarlino commented 6 years ago

parcel:serve, not parcel:server

It looks like I made a typo when writing this issue- I have updated the text.

try with a fresh master branch?

Does not appear to fix the issue- I will take a deeper look momentarily.