“...I've been working since 2008 with Ruby / Ruby on Rails, love a bit of Elixir / Phoenix and learning Rust.
I also poke through other people's code and make PRs for OpenSource Ruby projects that sometimes make it. Currently working for InPay who are based in Denmark...”
/Users/rl/.node-gyp/16.5.0/include/node/v8-internal.h:454:38: error: no template named 'remove_cv_t' in namespace 'std'; did you mean 'remove_cv'?
!std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
~~~~~^~~~~~~~~~~
remove_cv
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:776:50: note: 'remove_cv' declared here
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
^
1 error generated.
make: *** [Release/obj.target/binding/src/binding.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/rl/repos/rostering/vendor/engines/sard_core/ui/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (node:events:394:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Darwin 20.5.0
gyp ERR! command "/usr/local/Cellar/node/16.5.0/bin/node" "/Users/rl/repos/rostering/vendor/engines/sard_core/ui/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/rl/repos/rostering/vendor/engines/sard_core/ui/node_modules/node-sass
gyp ERR! node -v v16.5.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Yeah, srsly dude. This isn’t right for us either. I think that brew upgrade I did last night broke something, must have upgraded node. Apparently upgrading beyond node-sass 6.0.1 is fine now. Last time this happened I had to downgrade node.
Looks like Rails 6.0.4 upgrade has mangled the SQLJSONAPI-Resources is constructing.
Rswag::Specs::UnexpectedResponse:
Expected response code '500' to match '200'
Response body: {
"errors": [
{
"title": "Internal Server Error",
"detail": "Internal Server Error",
"code": "INTERNAL_SERVER_ERROR",
"status": "500",
"meta": {
"exception": "Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.\"id\" AS \"users_id\", users.last_name, users.first_name FROM `users` INNER JOIN `' at line 1",
The backtrace has lead me here.
From: /Users/rl/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activerecord-6.0.4/lib/active_record/relation/calculations.rb:186 ActiveRecord::Calculations#pluck:
181: def pluck(*column_names)
182: if loaded? && (column_names.map(&:to_s) - @klass.attribute_names - @klass.attribute_aliases.keys).empty?
183: return records.pluck(*column_names)
184: end
185:
=> 186: binding.pry
187:
188: if has_include?(column_names.first)
189: relation = apply_join_dependency
190: relation.pluck(*column_names)
191: else
192: klass.disallow_raw_sql!(column_names)
193: relation = spawn
194: relation.select_values = column_names
195: result = skip_query_cache_if_necessary { klass.connection.select_all(relation.arel, nil) }
196: result.cast_values(klass.attribute_types)
197: end
198: end
[1] pry(#<User::ActiveRecord_Relation>)> column_names
=> ["\"users\".\"id\" AS \"users_id\"", "users.last_name", "users.first_name"]
You wake in a dark room and someone has only gone and tainted your master branch by merging in multiple commits spanning weeks of work. We can’t possibly unpick 100+ commits, what the hell even were they? But we need master back as it was.
We can however, reset our master to a particular commit in the past that we trust.
Building RMagick with native extensions is playing up again… I use homebrew so I was looking for the right solution.
Using rexml 3.2.4
Fetching rmagick 2.13.4
Installing rmagick 2.13.4 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/rl/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rmagick-2.13.4/ext/RMagick
/Users/rl/.rbenv/versions/2.6.6/bin/ruby -I /Users/rl/.rbenv/versions/2.6.6/lib/ruby/2.6.0 -r ./siteconf20210707-24851-uczhdh.rb extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for clang... yes
checking for Magick-config... no
checking for pkg-config... yes
checking for ImageMagick version >= 6.4.9... yes
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... no
Can't install RMagick 2.13.4. Can't find MagickWand.h.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/rl/.rbenv/versions/2.6.6/bin/$(RUBY_BASE_NAME)
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/rl/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/extensions/x86_64-darwin-20/2.6.0/rmagick-2.13.4/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Users/rl/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rmagick-2.13.4 for inspection.
Results logged to /Users/rl/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/extensions/x86_64-darwin-20/2.6.0/rmagick-2.13.4/gem_make.out
An error occurred while installing rmagick (2.13.4), and Bundler cannot continue.
Make sure that `gem install rmagick -v '2.13.4' --source 'https://rubygems.org/'` succeeds before bundling.
Upgrading to Mongoid 7.x and found a pretty frightening change in behaviour for OR queries. Any unclear OR declarations could have devastating side-effects.
Now it combines them depending on the order they are declared. I am not entirely sure I like either way of declaring this. Having come from ActiveRecord land I would nearly always assume that you’re AND-ing everything you chain onto a scope.
So in this case we could look for our Tenant by ID, but actually find the first unexpired one instead. That’s one hell of a security hole.
I think the lesson here is to be extra cautious when using ‘OR’ in either ActiveRecord or Mongoid since the outcome is not always as obvious as you might think.
An upgrade or two back our Rails 6 app lost line comments. I can’t remember if it was trying to improve speed or the upgrade to sassc. Well it’s fixed now.
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
# config.assets.debug = true
# config.sass.line_comments = false
config.sass.inline_source_maps = true