Missing Gemfile entry for "sprockets"


(Darix) #1

According to the rubygems page for sass-rails 4.0.5 the dependency in the discourse/Gemfile.lock at master · discourse/discourse · GitHub do not match that of the upstream package.

Wouldn’t the proper solution be add the following to the Gemfile?

gem 'sprockets', '~> 2.11.0'

(Jeff Atwood) #2

@sam was upgrading our Rails versions and messing with the gemfile, any ideas here @sam?


(Alan Tan) #3

We do not have to add it into the Gemfile. Dependencies for a gem are handled automatically by Bundler when you do a bundle install so we don’t have to manually handle the dependencies of each and every single gem ourselves.

Also, I don’t see why it doesn’t match :wink:

Gemfile.lock is locking it to sprockets (~> 2.8, <= 2.11.0) while RubyGems.org requires sprockets (~> 2.8, < 3.0) and that is within the same range.


(Sam Saffron) #4

Note, I do plan to update sass and sprockets, but we have a lot of hacks there to enable custom css per site and so on, need to be super careful we don’t regress.


(Darix) #5

without locking sprockets down you get:

rake aborted!
NoMethodError: undefined method `imported_filenames' for #<DiscourseSassImporter:0x0000000272b878>
  (in /srv/www/vhosts/discourse/app/assets/stylesheets/admin.scss)
/usr/bin/rake.ruby2.2:33:in `<main>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
fatal: Not a git repository (or any parent up to mount point /srv)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

So until this is fixed and you can actually handle newer versions, i would recommend having the gem entry for sprockets in the gem file.


(Alan Tan) #6

What version of sprockets are you running in dev?


(Darix) #7

My pasted error was with 2.12.3.

If there is a general agreement for this, i would send a pull request.


(Sam Saffron) #14

I would much prefer a PR that demos how to upgrade sass and sprockets, that has extreme value to us


(Darix) #15

Sadly i am not an expert in that part …


(Mike Mayer) #16

@sam, upgrading sass seems to create a waterfall of issues – the greatest being it seems to push an upgrade of the Tilt Gem creates problems for Handlebars and the Freedom Patch, the better_handlebars_errors.rb.

I tried to solve it for you, but I got stuck.

Maybe I’m mistaken, but locking Sprockets (and perhaps other gems) is helpful to produce some grounding framework as people work on extensibility projects around Discourse.

I just triggered the same issue as @darix reported above while developing a plugin.


(Sam Saffron) #17

I feel we got to move forward here, I really loath being stuck on an old version of gems, especially sprockets its such a key gem for us.


(Mike Mayer) #18

O Captain! My Captain!

I’ll follow where you lead us.


(Alan Tan) #19

Going to add this to my list after the 1.5 release.

I can’t get Discourse on Rails 5 trunk (we need to run some benchmarks) with Sprockets locked to an outdated version.