y-crdt / yrb

Ruby bindings for yrs.
https://y-crdt.github.io/yrb
MIT License
80 stars 5 forks source link

cannot install y-rb(v0.5.4) with Rails 7.1 #157

Closed mackeee-orange closed 6 months ago

mackeee-orange commented 7 months ago

Gemfile: Almost default rails gemfile and use y-rb latest version.

source "https://rubygems.org"

ruby "3.2.1"

gem "rails", "~> 7.1.3", ">= 7.1.3.2"
gem "pg", "~> 1.1"
gem "puma", ">= 5.0"
gem "tzinfo-data", platforms: %i[ windows jruby ]
gem "bootsnap", require: false

gem 'y-rb', '~> 0.5.4'

group :development, :test do
  gem "debug", platforms: %i[ mri windows ]
end

then bundle install

➜  hoge git:(main) ✗ bundle install
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Installing y-rb 0.5.4 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/y-rb-0.5.4/ext/yrb
/Users/mackeee/.rbenv/versions/3.2.1/bin/ruby extconf.rb
checking for clang... yes
checking for clang++... yes
checking for ar... yes
checking for cargo... yes

current directory: /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/y-rb-0.5.4/ext/yrb
make DESTDIR\= sitearchdir\=./.gem.20240307-40854-qc09b2 sitelibdir\=./.gem.20240307-40854-qc09b2 clean

current directory: /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/y-rb-0.5.4/ext/yrb
make DESTDIR\= sitearchdir\=./.gem.20240307-40854-qc09b2 sitelibdir\=./.gem.20240307-40854-qc09b2
generating target/release/libyrb.dylib (release)
cargo rustc  --manifest-path ./Cargo.toml --target-dir target --lib --profile release -- -C linker=clang -L native=/Users/mackeee/.rbenv/versions/3.2.1/lib -L native=/opt/homebrew/opt/openssl@3/lib -L native=/opt/homebrew/opt/gmp/lib -C
link-arg=-Wl,-undefined,dynamic_lookup -l pthread
    Updating crates.io index
   Compiling libc v0.2.153
   Compiling proc-macro2 v1.0.78
   Compiling unicode-ident v1.0.12
   Compiling memchr v2.7.1
   Compiling glob v0.3.1
   Compiling cfg-if v1.0.0
   Compiling regex-syntax v0.8.2
   Compiling minimal-lexical v0.2.1
   Compiling either v1.10.0
   Compiling bindgen v0.69.4
   Compiling getrandom v0.1.16
   Compiling rustc-hash v1.1.0
   Compiling shlex v1.3.0
   Compiling bitflags v2.4.2
   Compiling lazycell v1.3.0
   Compiling libloading v0.8.3
   Compiling lazy_static v1.4.0
   Compiling shell-words v1.1.0
   Compiling thiserror v1.0.57
   Compiling serde v1.0.197
   Compiling itertools v0.12.1
   Compiling ppv-lite86 v0.2.17
   Compiling smallvec v1.13.1
   Compiling serde_json v1.0.114
   Compiling rb-sys-env v0.1.2
   Compiling itoa v1.0.10
   Compiling ryu v1.0.17
   Compiling atomic_refcell v0.1.13
   Compiling seq-macro v0.3.5
   Compiling aho-corasick v1.1.2
   Compiling nom v7.1.3
   Compiling clang-sys v1.7.0
   Compiling smallstr v0.3.0
   Compiling smallstr v0.2.0
   Compiling magnus v0.6.2
   Compiling quote v1.0.35
   Compiling rand_core v0.5.1
   Compiling syn v2.0.52
   Compiling rand_chacha v0.2.2
   Compiling rand v0.7.3
   Compiling regex-automata v0.4.6
   Compiling cexpr v0.6.0
   Compiling regex v1.10.3
   Compiling thiserror-impl v1.0.57
   Compiling magnus-macros v0.6.0
   Compiling lib0 v0.16.10
   Compiling yrs v0.17.4
   Compiling yrs v0.16.10
   Compiling rb-sys-build v0.9.90
   Compiling y-sync v0.3.1
   Compiling rb-sys v0.9.90
error[E0053]: method `decode` has an incompatible type for trait
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/y-sync-0.3.1/src/awareness.rs:300:47
    |
300 |     fn decode<D: Decoder>(decoder: &mut D) -> Result<Self, lib0::error::Error> {
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                                               |
    |                                               expected `yrs::encoding::read::Error`, found `lib0::error::Error`
    |                                               help: change the output type to match the trait: `Result<AwarenessUpdate, yrs::encoding::read::Error>`
    |
    = note: expected signature `fn(&mut D) -> Result<_, yrs::encoding::read::Error>`
               found signature `fn(&mut D) -> Result<_, lib0::error::Error>`

error[E0053]: method `decode` has an incompatible type for trait
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/y-sync-0.3.1/src/sync.rs:186:47
    |
186 |     fn decode<D: Decoder>(decoder: &mut D) -> Result<Self, lib0::error::Error> {
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                                               |
    |                                               expected `yrs::encoding::read::Error`, found `lib0::error::Error`
    |                                               help: change the output type to match the trait: `Result<Message, yrs::encoding::read::Error>`
    |
    = note: expected signature `fn(&mut D) -> Result<_, yrs::encoding::read::Error>`
               found signature `fn(&mut D) -> Result<_, lib0::error::Error>`

error[E0053]: method `decode` has an incompatible type for trait
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/y-sync-0.3.1/src/sync.rs:249:47
    |
249 |     fn decode<D: Decoder>(decoder: &mut D) -> Result<Self, lib0::error::Error> {
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                                               |
    |                                               expected `yrs::encoding::read::Error`, found `lib0::error::Error`
    |                                               help: change the output type to match the trait: `Result<SyncMessage, yrs::encoding::read::Error>`
    |
    = note: expected signature `fn(&mut D) -> Result<_, yrs::encoding::read::Error>`
               found signature `fn(&mut D) -> Result<_, lib0::error::Error>`

error[E0277]: `?` couldn't convert the error to `lib0::error::Error`
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/y-sync-0.3.1/src/awareness.rs:301:44
    |
301 |         let len: usize = decoder.read_var()?;
    |                                            ^ the trait `From<yrs::encoding::read::Error>` is not implemented for `lib0::error::Error`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <lib0::error::Error as From<lib0::json_parser::JsonParseError>>
              <lib0::error::Error as From<std::io::Error>>
    = note: required for `Result<AwarenessUpdate, lib0::error::Error>` to implement `FromResidual<Result<Infallible, yrs::encoding::read::Error>>`

error[E0277]: `?` couldn't convert the error to `lib0::error::Error`
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/y-sync-0.3.1/src/awareness.rs:304:57
    |
304 |             let client_id: ClientID = decoder.read_var()?;
    |                                                         ^ the trait `From<yrs::encoding::read::Error>` is not implemented for `lib0::error::Error`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <lib0::error::Error as From<lib0::json_parser::JsonParseError>>
              <lib0::error::Error as From<std::io::Error>>
    = note: required for `Result<AwarenessUpdate, lib0::error::Error>` to implement `FromResidual<Result<Infallible, yrs::encoding::read::Error>>`

error[E0277]: `?` couldn't convert the error to `lib0::error::Error`
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/y-sync-0.3.1/src/awareness.rs:305:48
    |
305 |             let clock: u32 = decoder.read_var()?;
    |                                                ^ the trait `From<yrs::encoding::read::Error>` is not implemented for `lib0::error::Error`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <lib0::error::Error as From<lib0::json_parser::JsonParseError>>
              <lib0::error::Error as From<std::io::Error>>
    = note: required for `Result<AwarenessUpdate, lib0::error::Error>` to implement `FromResidual<Result<Infallible, yrs::encoding::read::Error>>`

error[E0277]: `?` couldn't convert the error to `lib0::error::Error`
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/y-sync-0.3.1/src/awareness.rs:306:45
    |
306 |             let json = decoder.read_string()?.to_string();
    |                                             ^ the trait `From<yrs::encoding::read::Error>` is not implemented for `lib0::error::Error`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <lib0::error::Error as From<lib0::json_parser::JsonParseError>>
              <lib0::error::Error as From<std::io::Error>>
    = note: required for `Result<AwarenessUpdate, lib0::error::Error>` to implement `FromResidual<Result<Infallible, yrs::encoding::read::Error>>`

error[E0277]: `?` couldn't convert the error to `lib0::error::Error`
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/y-sync-0.3.1/src/sync.rs:187:41
    |
187 |         let tag: u8 = decoder.read_var()?;
    |                                         ^ the trait `From<yrs::encoding::read::Error>` is not implemented for `lib0::error::Error`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <lib0::error::Error as From<lib0::json_parser::JsonParseError>>
              <lib0::error::Error as From<std::io::Error>>
    = note: required for `Result<Message, lib0::error::Error>` to implement `FromResidual<Result<Infallible, yrs::encoding::read::Error>>`

error[E0277]: `?` couldn't convert the error to `lib0::error::Error`
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/y-sync-0.3.1/src/sync.rs:190:55
    |
190 |                 let msg = SyncMessage::decode(decoder)?;
    |                                                       ^ the trait `From<yrs::encoding::read::Error>` is not implemented for `lib0::error::Error`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <lib0::error::Error as From<lib0::json_parser::JsonParseError>>
              <lib0::error::Error as From<std::io::Error>>
    = note: required for `Result<Message, lib0::error::Error>` to implement `FromResidual<Result<Infallible, yrs::encoding::read::Error>>`

error[E0277]: `?` couldn't convert the error to `lib0::error::Error`
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/y-sync-0.3.1/src/sync.rs:194:46
    |
194 |                 let data = decoder.read_buf()?;
    |                                              ^ the trait `From<yrs::encoding::read::Error>` is not implemented for `lib0::error::Error`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <lib0::error::Error as From<lib0::json_parser::JsonParseError>>
              <lib0::error::Error as From<std::io::Error>>
    = note: required for `Result<Message, lib0::error::Error>` to implement `FromResidual<Result<Infallible, yrs::encoding::read::Error>>`

error[E0277]: `?` couldn't convert the error to `lib0::error::Error`
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/y-sync-0.3.1/src/sync.rs:195:62
    |
195 |                 let update = AwarenessUpdate::decode_v1(data)?;
    |                                                              ^ the trait `From<yrs::encoding::read::Error>` is not implemented for `lib0::error::Error`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <lib0::error::Error as From<lib0::json_parser::JsonParseError>>
              <lib0::error::Error as From<std::io::Error>>
    = note: required for `Result<Message, lib0::error::Error>` to implement `FromResidual<Result<Infallible, yrs::encoding::read::Error>>`

error[E0277]: `?` couldn't convert the error to `lib0::error::Error`
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/y-sync-0.3.1/src/sync.rs:199:57
    |
199 |                 let reason = if decoder.read_var::<u8>()? == PERMISSION_DENIED {
    |                                                         ^ the trait `From<yrs::encoding::read::Error>` is not implemented for `lib0::error::Error`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <lib0::error::Error as From<lib0::json_parser::JsonParseError>>
              <lib0::error::Error as From<std::io::Error>>
    = note: required for `Result<Message, lib0::error::Error>` to implement `FromResidual<Result<Infallible, yrs::encoding::read::Error>>`

error[E0277]: `?` couldn't convert the error to `lib0::error::Error`
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/y-sync-0.3.1/src/sync.rs:200:47
    |
200 |                     Some(decoder.read_string()?.to_string())
    |                                               ^ the trait `From<yrs::encoding::read::Error>` is not implemented for `lib0::error::Error`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <lib0::error::Error as From<lib0::json_parser::JsonParseError>>
              <lib0::error::Error as From<std::io::Error>>
    = note: required for `Result<Message, lib0::error::Error>` to implement `FromResidual<Result<Infallible, yrs::encoding::read::Error>>`

error[E0277]: `?` couldn't convert the error to `lib0::error::Error`
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/y-sync-0.3.1/src/sync.rs:208:46
    |
208 |                 let data = decoder.read_buf()?;
    |                                              ^ the trait `From<yrs::encoding::read::Error>` is not implemented for `lib0::error::Error`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <lib0::error::Error as From<lib0::json_parser::JsonParseError>>
              <lib0::error::Error as From<std::io::Error>>
    = note: required for `Result<Message, lib0::error::Error>` to implement `FromResidual<Result<Infallible, yrs::encoding::read::Error>>`

error[E0277]: `?` couldn't convert the error to `lib0::error::Error`
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/y-sync-0.3.1/src/sync.rs:250:41
    |
250 |         let tag: u8 = decoder.read_var()?;
    |                                         ^ the trait `From<yrs::encoding::read::Error>` is not implemented for `lib0::error::Error`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <lib0::error::Error as From<lib0::json_parser::JsonParseError>>
              <lib0::error::Error as From<std::io::Error>>
    = note: required for `Result<SyncMessage, lib0::error::Error>` to implement `FromResidual<Result<Infallible, yrs::encoding::read::Error>>`

error[E0277]: `?` couldn't convert the error to `lib0::error::Error`
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/y-sync-0.3.1/src/sync.rs:253:45
    |
253 |                 let buf = decoder.read_buf()?;
    |                                             ^ the trait `From<yrs::encoding::read::Error>` is not implemented for `lib0::error::Error`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <lib0::error::Error as From<lib0::json_parser::JsonParseError>>
              <lib0::error::Error as From<std::io::Error>>
    = note: required for `Result<SyncMessage, lib0::error::Error>` to implement `FromResidual<Result<Infallible, yrs::encoding::read::Error>>`

error[E0277]: `?` couldn't convert the error to `lib0::error::Error`
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/y-sync-0.3.1/src/sync.rs:254:53
    |
254 |                 let sv = StateVector::decode_v1(buf)?;
    |                                                     ^ the trait `From<yrs::encoding::read::Error>` is not implemented for `lib0::error::Error`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <lib0::error::Error as From<lib0::json_parser::JsonParseError>>
              <lib0::error::Error as From<std::io::Error>>
    = note: required for `Result<SyncMessage, lib0::error::Error>` to implement `FromResidual<Result<Infallible, yrs::encoding::read::Error>>`

error[E0277]: `?` couldn't convert the error to `lib0::error::Error`
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/y-sync-0.3.1/src/sync.rs:258:45
    |
258 |                 let buf = decoder.read_buf()?;
    |                                             ^ the trait `From<yrs::encoding::read::Error>` is not implemented for `lib0::error::Error`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <lib0::error::Error as From<lib0::json_parser::JsonParseError>>
              <lib0::error::Error as From<std::io::Error>>
    = note: required for `Result<SyncMessage, lib0::error::Error>` to implement `FromResidual<Result<Infallible, yrs::encoding::read::Error>>`

error[E0277]: `?` couldn't convert the error to `lib0::error::Error`
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/y-sync-0.3.1/src/sync.rs:262:45
    |
262 |                 let buf = decoder.read_buf()?;
    |                                             ^ the trait `From<yrs::encoding::read::Error>` is not implemented for `lib0::error::Error`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
    = help: the following other types implement trait `From<T>`:
              <lib0::error::Error as From<lib0::json_parser::JsonParseError>>
              <lib0::error::Error as From<std::io::Error>>
    = note: required for `Result<SyncMessage, lib0::error::Error>` to implement `FromResidual<Result<Infallible, yrs::encoding::read::Error>>`

error[E0308]: mismatched types
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/y-sync-0.3.1/src/sync.rs:324:17
    |
322 |         match Message::decode(self.0) {
    |               ----------------------- this expression has type `Result<Message, yrs::encoding::read::Error>`
323 |             Ok(msg) => Some(Ok(msg)),
324 |             Err(lib0::error::Error::EndOfBuffer(_)) => None,
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `yrs::encoding::read::Error`, found `lib0::error::Error`
    |
    = note: `lib0::error::Error` and `yrs::encoding::read::Error` have similar names, but are actually distinct types
note: `lib0::error::Error` is defined in crate `lib0`
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lib0-0.16.10/src/error.rs:4:1
    |
4   | pub enum Error {
    | ^^^^^^^^^^^^^^
note: `yrs::encoding::read::Error` is defined in crate `yrs`
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/yrs-0.17.4/src/encoding/read.rs:6:1
    |
6   | pub enum Error {
    | ^^^^^^^^^^^^^^

error[E0308]: mismatched types
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/y-sync-0.3.1/src/sync.rs:325:36
    |
325 |             Err(error) => Some(Err(error)),
    |                                --- ^^^^^ expected `lib0::error::Error`, found `yrs::encoding::read::Error`
    |                                |
    |                                arguments to this enum variant are incorrect
    |
    = note: `yrs::encoding::read::Error` and `lib0::error::Error` have similar names, but are actually distinct types
note: `yrs::encoding::read::Error` is defined in crate `yrs`
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/yrs-0.17.4/src/encoding/read.rs:6:1
    |
6   | pub enum Error {
    | ^^^^^^^^^^^^^^
note: `lib0::error::Error` is defined in crate `lib0`
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lib0-0.16.10/src/error.rs:4:1
    |
4   | pub enum Error {
    | ^^^^^^^^^^^^^^
help: the type constructed contains `yrs::encoding::read::Error` due to the type of the argument passed
   --> /Users/mackeee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/y-sync-0.3.1/src/sync.rs:325:32
    |
325 |             Err(error) => Some(Err(error)),
    |                                ^^^^-----^
    |                                    |
    |                                    this argument influences the type of `Err`
note: tuple variant defined here
   --> /Users/mackeee/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/result.rs:511:5
    |
511 |     Err(#[stable(feature = "rust1", since = "1.0.0")] E),
    |     ^^^

Some errors have detailed explanations: E0053, E0277, E0308.
For more information about an error, try `rustc --explain E0053`.
error: could not compile `y-sync` (lib) due to 21 previous errors
warning: build failed, waiting for other jobs to finish...
make: *** [target/release/libyrb.dylib] Error 101

make failed, exit code 2

Gem files will remain installed in /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/y-rb-0.5.4 for inspection.
Results logged to /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/extensions/arm64-darwin-23/3.2.0/y-rb-0.5.4/gem_make.out

  /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/ext/builder.rb:125:in `run'
  /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/ext/builder.rb:51:in `block in make'
  /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/ext/builder.rb:43:in `each'
  /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/ext/builder.rb:43:in `make'
  /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/ext/ext_conf_builder.rb:42:in `build'
  /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/ext/builder.rb:193:in `build_extension'
  /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/ext/builder.rb:227:in `block in build_extensions'
  /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/ext/builder.rb:224:in `each'
  /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/ext/builder.rb:224:in `build_extensions'
  /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/installer.rb:852:in `build_extensions'
  /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bundler-2.5.6/lib/bundler/rubygems_gem_installer.rb:76:in `build_extensions'
  /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bundler-2.5.6/lib/bundler/rubygems_gem_installer.rb:28:in `install'
  /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bundler-2.5.6/lib/bundler/source/rubygems.rb:205:in `install'
  /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bundler-2.5.6/lib/bundler/installer/gem_installer.rb:54:in `install'
  /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bundler-2.5.6/lib/bundler/installer/gem_installer.rb:16:in `install_from_spec'
  /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bundler-2.5.6/lib/bundler/installer/parallel_installer.rb:132:in `do_install'
  /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bundler-2.5.6/lib/bundler/installer/parallel_installer.rb:123:in `block in worker_pool'
  /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bundler-2.5.6/lib/bundler/worker.rb:62:in `apply_func'
  /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bundler-2.5.6/lib/bundler/worker.rb:57:in `block in process_queue'
  /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bundler-2.5.6/lib/bundler/worker.rb:54:in `loop'
  /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bundler-2.5.6/lib/bundler/worker.rb:54:in `process_queue'
  /Users/mackeee/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bundler-2.5.6/lib/bundler/worker.rb:90:in `block (2 levels) in create_threads'

An error occurred while installing y-rb (0.5.4), and Bundler cannot continue.

In Gemfile:
  y-rb
eliias commented 7 months ago

@mackeee-orange It seems you are not getting any of the precompiled binaries, but instead compile the extension yourself. Could you provide more details about your environment (OS, architecture, rust version), and if you actually want to compile the extension yourself, or is it just the binary download not working for you?

Here is the list of supported platforms:

Screenshot 2024-03-07 at 11 04 47
eliias commented 7 months ago

@mackeee-orange I just verified that installation from the binary works on a M1 with a clean 3.2.1 Ruby. There must be something that prevents you from downloading the extension binaries. Is it possible that you force the "ruby platform" in your local or global bundle config?

# .bundle/config
BUNDLE_FORCE_RUBY_PLATFORM: "true"
mackeee-orange commented 7 months ago

@eliias Thank you for reply.

This is my env info:

.bundle/config BUNDLE_FORCE_RUBY_PLATFORM: "true"

it did not work in my environment.

mackeee-orange commented 7 months ago

Currently, I'm use this gem in Docker container (base image ruby:3.2). It seems well at the moment.

I put my dockerfile just in case

# syntax=docker/dockerfile:experimental

FROM ruby:3.2
ENV LANG C.UTF-8

RUN apt-get update -qq && \
    apt-get install -y \
    cmake \
    build-essential \
    libpq-dev \
    nodejs \
    imagemagick \
    graphviz \
    tree \
    zlib1g-dev \
    liblzma-dev \
    patch \
    libgit2-dev \
    pkg-config \
    libicu-dev \
    libcurl4-openssl-dev \
    libssl-dev \
    tzdata \
    postgresql-client

# Rust install
ENV RUST_HOME /usr/local/lib/rust
ENV RUSTUP_HOME ${RUST_HOME}/rustup
ENV CARGO_HOME ${RUST_HOME}/cargo
RUN mkdir /usr/local/lib/rust && \
    chmod 0755 $RUST_HOME
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > ${RUST_HOME}/rustup.sh \
    && chmod +x ${RUST_HOME}/rustup.sh \
    && ${RUST_HOME}/rustup.sh -y --default-toolchain nightly --no-modify-path
ENV PATH $PATH:$CARGO_HOME/bin

ENV APP_ROOT /app
WORKDIR ${APP_ROOT}

COPY ./Gemfile ${APP_ROOT}/
COPY ./Gemfile.lock ${APP_ROOT}/

ENV BUNDLER_VERSION 2.5.5
RUN gem update --system \
    && gem install bundler -v $BUNDLER_VERSION \
    && bundle install --jobs 4 --retry 3

COPY . .

EXPOSE 3000

WORKDIR ${APP_ROOT}

CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]

@eliias So, this my probrem is solved for now. But if you want, I will provide more information, or of course you can close this issue.

eliias commented 7 months ago

.bundle/config BUNDLE_FORCE_RUBY_PLATFORM: "true"

it did not work in my environment.

To clarify, BUNDLE_FORCE_RUBY_PLATFORM: "true" this would force bundler to compile the extension, instead of downloading. I am curious what triggered the compilation in your env, as your platform is supported, and we actually provide a binary for it. The whole purpose of building these binaries is to avoid issues such as this one :-).

I am going to try to fix the compilation issue though, this isn't working as intended.

eliias commented 7 months ago

@mackeee-orange Could you try the latest release (v0.5.5) in your dev environment and report back here. I think the compilation might have been a dependency issue.