Skip to content

Ruby: Gem version 3.12.1 doesn't load on Ruby 2.7 or 2.6.6 with Rails 5.1.7 #7541

@MatayoshiMariano

Description

@MatayoshiMariano

What version of protobuf and what language are you using?
Version: 3.12.1
Language: Ruby

What operating system (Linux, Windows, ...) and version?
Alpine 3.11.6

What runtime / compiler are you using (e.g., python version or gcc version)

  • Ruby 2.7.1/ Rails 5.1.7
  • Ruby 2.6.6/ Rails 5.1.7

What did you do?
Steps to reproduce the behavior:

  1. CFLAGS="-Wno-cast-function-type" BUNDLE_FORCE_RUBY_PLATFORM=1 bundle update google-protobuf
  2. Run bundle exec rails server
  3. Get Load Errors, see below.

What did you expect to see
Initiate the rails server

What did you see instead?

Traceback (most recent call last):
        19: from bin/rails:4:in `<main>'
        18: from bin/rails:4:in `require'
        17: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/commands.rb:16:in `<top (required)>'
        16: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/command.rb:44:in `invoke'
        15: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/command/base.rb:63:in `perform'
        14: from /usr/local/bundle/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
        13: from /usr/local/bundle/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
        12: from /usr/local/bundle/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
        11: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/commands/server/server_command.rb:130:in `perform'
        10: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/commands/server/server_command.rb:130:in `tap'
         9: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/commands/server/server_command.rb:133:in `block in perform'
         8: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/commands/server/server_command.rb:133:in `require'
         7: from /var/app/config/application.rb:21:in `<top (required)>'
         6: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler.rb:174:in `require'
         5: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `require'
         4: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `each'
         3: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `block in require'
         2: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `each'
         1: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in `block (2 levels) in require'
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in `require': cannot load such file -- google-protobuf (LoadError)
        23: from bin/rails:4:in `<main>'
        22: from bin/rails:4:in `require'
        21: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/commands.rb:16:in `<top (required)>'
        20: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/command.rb:44:in `invoke'
        19: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/command/base.rb:63:in `perform'
        18: from /usr/local/bundle/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
        17: from /usr/local/bundle/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
        16: from /usr/local/bundle/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
        15: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/commands/server/server_command.rb:130:in `perform'
        14: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/commands/server/server_command.rb:130:in `tap'
        13: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/commands/server/server_command.rb:133:in `block in perform'
        12: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/commands/server/server_command.rb:133:in `require'
        11: from /var/app/config/application.rb:21:in `<top (required)>'
        10: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler.rb:174:in `require'
         9: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `require'
         8: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `each'
         7: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:65:in `block in require'
         6: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:88:in `rescue in block in require'
         5: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:88:in `require'
         4: from /usr/local/bundle/gems/google-protobuf-3.12.1/lib/google/protobuf.rb:49:in `<top (required)>'
         3: from /usr/local/bundle/gems/activesupport-5.1.7/lib/active_support/dependencies.rb:292:in `require'
         2: from /usr/local/bundle/gems/activesupport-5.1.7/lib/active_support/dependencies.rb:258:in `load_dependency'
         1: from /usr/local/bundle/gems/activesupport-5.1.7/lib/active_support/dependencies.rb:292:in `block in require'
/usr/local/bundle/gems/activesupport-5.1.7/lib/active_support/dependencies.rb:292:in `require': cannot load such file -- google/2.7/protobuf_c (LoadError)
        24: from bin/rails:4:in `<main>'
        23: from bin/rails:4:in `require'
        22: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/commands.rb:16:in `<top (required)>'
        21: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/command.rb:44:in `invoke'
        20: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/command/base.rb:63:in `perform'
        19: from /usr/local/bundle/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
        18: from /usr/local/bundle/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
        17: from /usr/local/bundle/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
        16: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/commands/server/server_command.rb:130:in `perform'
        15: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/commands/server/server_command.rb:130:in `tap'
        14: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/commands/server/server_command.rb:133:in `block in perform'
        13: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/commands/server/server_command.rb:133:in `require'
        12: from /var/app/config/application.rb:21:in `<top (required)>'
        11: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler.rb:174:in `require'
        10: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `require'
         9: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `each'
         8: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:65:in `block in require'
         7: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:88:in `rescue in block in require'
         6: from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:88:in `require'
         5: from /usr/local/bundle/gems/google-protobuf-3.12.1/lib/google/protobuf.rb:48:in `<top (required)>'
         4: from /usr/local/bundle/gems/google-protobuf-3.12.1/lib/google/protobuf.rb:51:in `rescue in <top (required)>'
         3: from /usr/local/bundle/gems/activesupport-5.1.7/lib/active_support/dependencies.rb:292:in `require'
         2: from /usr/local/bundle/gems/activesupport-5.1.7/lib/active_support/dependencies.rb:258:in `load_dependency'
         1: from /usr/local/bundle/gems/activesupport-5.1.7/lib/active_support/dependencies.rb:292:in `block in require'
/usr/local/bundle/gems/activesupport-5.1.7/lib/active_support/dependencies.rb:292:in `require': Error relocating /usr/local/bundle/gems/google-protobuf-3.12.1/lib/google/protobuf_c.so: __va_copy: symbol not found - /usr/local/bundle/gems/google-protobuf-3.12.1/lib/google/protobuf_c.so (LoadError

Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).

Anything else we should know about your project / environment
What does work for me is using Ruby 2.6.6, Rails 5.1.7 and google-protobuf 3.9.2

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions