<Na_Klar>
I try to prepare a byte string for a serial port communication "\xFE\xFE\x94...". By default ruby seems to encode that as utf-8. So I add .encode(Encoding::ASCII) to the string. But this fails with "encode: \xFE on UTF-8 (Encoding::InvalidByteSequenceError)". Why?
<Na_Klar>
ah, because ruby tries to convert that from utf-8 to ascii. .. so how do I tell ruby, that the string should be ascii and not utf-8 in the frist place?
jenrzzz has joined #ruby
<Na_Klar>
ah .force_encoding does the trick
c10l has quit [Remote host closed the connection]
gr33n7007h has joined #ruby
c10l has joined #ruby
<[0x1eef_]>
Na_Klar: ""\xFE\xFE\x94...".b works as well.
<Neowise>
15f797160eff512b5712a20f892ba262cd5060d9` in directory /home/gerard/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/sigma-theme-15f797160eff
<osc4rpt>
can someone explain how this actually work?: ActiveRecord::Base.logger = ActiveSupport::Logger.new($stdout) I understand that ActiveRecord is a module defined by an activerecord gem and that Base is the class inherited by that method. Also, as far as i understand ActiveSupport::Logger.new($stdout) is creating a new instance of a class Logger, but what is .logger?
jenrzzz has joined #ruby
<osc4rpt>
in my undestanding if we were to create an object of that Logger class, we would just do that outside of "ActiveRecord::Base" context, like that: somelogger = ActiveSupport::Logger.new($stdout)
<osc4rpt>
so i guess the logger is a method, and everything points to that, but what are we doing with that method? are we overwriting it or adding something to it?
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
MarvelousWololo has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
MarvelousWololo has quit [Remote host closed the connection]
jenrzzz has joined #ruby
rvalue has quit [Ping timeout: 272 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
rvalue has joined #ruby
<adam12>
osc4rpt: Classes have instances themselves, called the eigenclass. You can add accessors to those classes. In this case, it's creating a new instance of Logger and then using the setter (writable accessor) to store the value off.
<adam12>
osc4rpt: Similar to any method in Ruby, `.logger=(value)` can be doing anything, as the implementation details are hidden away. It could be assigning `logger` to an Array of existing loggers (tho that would be weird UX).
<Neowise>
The only version of ruby that it works for me to install gems from github is 2.6.4.
<Neowise>
I don't know if it's a ruby issue, bundler issue or what
<Neowise>
I'm deleting the Gemfile.lock every time, before running 'bundle install'. Then this file is not even generated, so I generate it using the gems in local and then I change PATH to GIT (manually), getting new errors about locked version
<Neowise>
It's a fucking shit I have to stuck in older versions, tbh
<adam12>
Neowise: If you make a new temporary folder and do this, what happens? `bundle init; bundle add minima --git https://github.com/jekyll/minima.git`
<Neowise>
The first error: Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
<adam12>
That's OK
<Neowise>
Then some deprecated messages
<Neowise>
Then at the end: google-protobuf-3.25.2-x86_64-linux requires ruby version < 3.3.dev, >= 2.7, which is incompatible with the current version,
<Neowise>
ruby 3.3.0p0
<adam12>
So you have a few issues
<Neowise>
Most of deprecated messages are like that: NOTE: Gem::Platform.match is deprecated; use Gem::Platform.match_spec? or match_gem? instead. It will be removed in Rubygems 4
<Neowise>
Gem::Platform.match called from /home/gerard/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.1.2/lib/bundler/index.rb:198.
<adam12>
My guess is the main issue is your `git` version is super old. I think bundler might be passing arguments to it that are not recognized, hence the error.
<adam12>
Since you're on Debian 9, that makes some sense to me.
<adam12>
The second issue is that the dependency you're installing hasn't been updated to Ruby 3.3 support yet.
<Neowise>
Yes, probably is about that
<adam12>
So my suggestions are to use an older bundler (like we did by passing the _2.1.2_ version) and to try installing Ruby 3.2.
<adam12>
That might get you to where you need to be.
<Neowise>
Oh, I will try with Ruby 3.2
<Neowise>
If not, some day I will have to upgrade the system
<adam12>
Yeah. I'm amazed you're still running 9.
<adam12>
I have some 11 machines but mostly on 12. I don't think I even have anything left on 10
<adam12>
Yes, could be! By forcing an older version, I wanted to find something that more closely matched the release date of your `git` version, but it could be that too.
<adam12>
That's a fix for a super ancient issue. Maybe you could see what version it was caused by. But you have a working bundler version (2.1.2) so you could play with different versions if you wanted to.
<adam12>
Just slowly add newer versions and see when it breaks.
<Neowise>
Yes, I think it's the way
<Neowise>
Thanks a lot for the help!
<adam12>
I thought it was a permission issue originally, hence asking for the `ls` output, but there's a lot of moving pieces here so it makes it hard to debug.
<adam12>
Your welcome!
<Neowise>
Yep, it's a issue to spend the afternoon
<adam12>
I hear ya :(
Vonter has quit [Ping timeout: 256 seconds]
osc4rpt has quit [Ping timeout: 246 seconds]
Vonter has joined #ruby
osc4rpt has joined #ruby
finsternis has joined #ruby
heinrich5991 has quit [Quit: quit.]
heinrich5991 has joined #ruby
user71 has quit [Quit: Leaving]
jenrzzz has quit [Ping timeout: 276 seconds]
jenrzzz has joined #ruby
Neowise has quit [Quit: leaving]
jenrzzz has quit [Ping timeout: 255 seconds]
reset has joined #ruby
jenrzzz has joined #ruby
desnudopenguino has quit [Remote host closed the connection]