thoughtbot / appraisal

A Ruby library for testing your library against different versions of dependencies.
https://thoughtbot.com
MIT License
1.26k stars 107 forks source link

Sprockets::Railtie::ManifestNeededError -- Expected to find a manifest file in `app/assets/config/manifest.js` #161

Closed jasonfb closed 4 years ago

jasonfb commented 4 years ago

I seem to be getting this error when running bundle exec appraisal rails-6-0 rake spec,

Failure/Error: super unless @initialized

Sprockets::Railtie::ManifestNeededError:
  Expected to find a manifest file in `app/assets/config/manifest.js`
  But did not, please create this file and use it to link any assets that need
  to be rendered by your app:

  Example:
    //= link_tree ../images
    //= link_directory ../javascripts .js
    //= link_directory ../stylesheets .css
  and restart your server

my Appraisals file look like


appraise "rails-4-2" do
  gem "rails", "4.2.11.1"
  gem "rspec-rails", '~> 3.1'
end

appraise "rails-5-0" do
  gem "rails", "5.0.7.2"
  gem "rspec-rails", '~> 3.1'
end

appraise "rails-5-1" do
  gem "rails", "5.1.7"
  gem "rspec-rails", '~> 3.1'
end

appraise "rails-5-2" do
  gem "rails", "5.2.4.rc1"
  gem "rspec-rails", '~> 3.1'
end

appraise "rails-6-0" do
  gem "rails", "6.0.1"
  gem "rspec-rails", '~> 4.0.0.beta2'
end

and I have a dummy app here in

spec/
  dummy/
     app/
        assets/
          config/
            manifest.js
        controllers/
          abc_controller.rb
          application_controller.rb

note that the dummy app itself has the app/assets/config/manifest.js, but it doesn't seem to be picked up when I run the specs

I'm trying to follow the same pattern I see in clearance to implement the Appraisals

jasonfb commented 4 years ago

this appears to go away if I make a file at app/assets/config/manifest.js at the ROOT of my project, not inside the 'dummy' app as I would expected.

I guess the expected result might be that I could make this file inside of the spec/dummy/ app

nickcharlton commented 4 years ago

I'm partial to think that this is a dummy_app setup issue, rather than Appraisal itself.

If you're still having this problem, how does the way Administrate solves this problem differ? I know we've had problems there with new Sprockets.

jasonfb commented 4 years ago

this was when I was working on https://github.com/jasonfb/universal_track_manager

It's hard to say but I think my original design for my gem had the specs, Appraisal setup, etc in the root of the gem folder structure, then I created a GEM_CODE/ subfolder and put all the gem code into that

I'm pretty sure that setup just basically didn't work at all, because I couldn't get around Appraisal's expectation that it be structured by having the gem code at the root folder.

Shortly after I opened this PR on Nov 19, I made this commit, which you can see moves the code out of GEM_CODE/ folder and into the root folder.

https://github.com/jasonfb/universal_track_manager/commit/44c8e6a798b556caf487987cdb106999f11da8f5

nickcharlton commented 4 years ago

I think what you've got now is more like how I'd expect to see things. I'm going to close this as it's not something Appraisal could easy help with.