Skip to content

Second try updateing to tackle paperclip vunerability as well as trouble with pg and minitest

Kaspar Vollenweider requested to merge bugfix/rails_update_2_0 into develop

Trello Story

Trouble discriptions

problem with pg gem

 ❯ rails db:drop                                                                                                                                     [10:31:03]
rails aborted!
Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded. Add `gem 'pg'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
/Users/kaspi/Projects/aoz-003/config/environment.rb:5:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'

Caused by:
Gem::LoadError: can't activate pg (~> 0.18), already activated pg-1.0.0. Make sure all dependencies are added to Gemfile.
/Users/kaspi/Projects/aoz-003/config/environment.rb:5:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => db:drop => db:check_protected_environments => environment
(See full trace by running task with --trace)

so far found:

Problem with minitest

Issue links found:

This Issue "MiniTest 5.11.0 -- error or failure also causes undefined method (for test name) backtrace" has a comment that this should be fixed with minitest 5.11.1.

I'm not yet sure, but as we have 5.11.1 bundled, I'm suspecting gitlab-ci caching to prevent the new gem being used.

In order to verify if this is realy the case, I'm intending to do a C&P try of this caching post from the gitlab forums.

Problem with autoprefixer-rails gem

Output in terminal with rails s:

ExecJS::RuntimeError - SyntaxError: Unexpected token ,:
  app/views/layouts/application.html.slim:11:in `_app_views_layouts_application_html_slim__1698350944137352683_70312468566440'

Output of rails assets:precompile is telling at least a slight bit more:

 ❯ rails assets:precompile                                                                                                                           [10:44:24]
yarn install v1.3.2
[1/4] 🔍  Resolving packages...
success Already up-to-date.
✨  Done in 0.26s.
rails aborted!
ExecJS::RuntimeError: SyntaxError: Unexpected token ,
Object.parse (native)
Object.parseSourceMapInput ((execjs):23991:15)
new SourceMapConsumer ((execjs):21717:22)
PreviousMap.consumer ((execjs):19241:34)
new Input ((execjs):16656:28)
parse ((execjs):18292:17)
new LazyResult ((execjs):16859:24)
Processor.process ((execjs):19459:12)
Function.creator.process ((execjs):19021:43)
process ((execjs):24252:45)
/Users/kaspi/.rbenv/gems/2.4.0/gems/autoprefixer-rails-7.2.5/lib/autoprefixer-rails/processor.rb:36:in `process'
bin/rails:4:in `require'
bin/rails:4:in `<main>'

Caused by:
V8::Error: Unexpected token , at <eval>:17033:36
at parseSourceMapInput (<eval>:23991:15)
at SourceMapConsumer (<eval>:21717:22)
at consumer (<eval>:19241:34)
at Input (<eval>:16656:28)
at parse (<eval>:18292:17)
at LazyResult (<eval>:16859:24)
at process (<eval>:19459:12)
at creator.process (<eval>:19021:43)
at process (<eval>:24252:45)
at <eval>:1:50
/Users/kaspi/.rbenv/gems/2.4.0/gems/autoprefixer-rails-7.2.5/lib/autoprefixer-rails/processor.rb:36:in `process'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => assets:precompile

Googling several fractions of the output didn't really give me any useful info on the topic so far.

For now the only commenting the Gem from the Gemfile did solve the problem. As autoprefixer isn't all that essential, we can skip it for now...

Edited by Kaspar Vollenweider

Merge request reports