Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot load such file -- 2.6.5/ruby_prof.so #269

Closed
the-nw1-group opened this issue Feb 28, 2020 · 8 comments
Closed

cannot load such file -- 2.6.5/ruby_prof.so #269

the-nw1-group opened this issue Feb 28, 2020 · 8 comments

Comments

@the-nw1-group
Copy link

On upgrading ruby prof from 1.2.0 to 1.3.0, and running our application, we get the following error:

Traceback (most recent call last):
        27: from bin/rails:6:in `<main>'
        26: from bin/rails:6:in `require'
        25: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.2.1/lib/rails/commands.rb:18:in `<top (required)>'
        24: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.2.1/lib/rails/command.rb:46:in `invoke'
        23: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.2.1/lib/rails/command/base.rb:69:in `perform'
        22: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
        21: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
        20: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
        19: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.2.1/lib/rails/commands/server/server_command.rb:138:in `perform'
        18: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.2.1/lib/rails/commands/server/server_command.rb:138:in `tap'
        17: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.2.1/lib/rails/commands/server/server_command.rb:141:in `block in perform'
        16: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require'
        15: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:291:in `load_dependency'
        14: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `block in require'
        13: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require'
        12: from C:/Projects/revscot/config/application.rb:22:in `<top (required)>'
        11: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler.rb:174:in `require'
        10: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `require'
         9: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `each'
         8: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `block in require'
         7: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `each'
         6: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in `block (2 levels) in require'
         5: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in `require'
         4: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ruby-prof-1.3.0-x64-mingw32/lib/ruby-prof.rb:6:in `<top (required)>'
         3: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require'
         2: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:291:in `load_dependency'
         1: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `block in require'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require': cannot load such file -- 2.6.5/ruby_prof.so (LoadError)
        28: from bin/rails:6:in `<main>'
        27: from bin/rails:6:in `require'
        26: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.2.1/lib/rails/commands.rb:18:in `<top (required)>'
        25: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.2.1/lib/rails/command.rb:46:in `invoke'
        24: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.2.1/lib/rails/command/base.rb:69:in `perform'
        23: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
        22: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
        21: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
        20: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.2.1/lib/rails/commands/server/server_command.rb:138:in `perform'
        19: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.2.1/lib/rails/commands/server/server_command.rb:138:in `tap'
        18: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.2.1/lib/rails/commands/server/server_command.rb:141:in `block in perform'
        17: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require'
        16: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:291:in `load_dependency'
        15: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `block in require'
        14: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require'
        13: from C:/Projects/revscot/config/application.rb:22:in `<top (required)>'
        12: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler.rb:174:in `require'
        11: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `require'
        10: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `each'
         9: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `block in require'
         8: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `each'
         7: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in `block (2 levels) in require'
         6: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in `require'
         5: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ruby-prof-1.3.0-x64-mingw32/lib/ruby-prof.rb:4:in `<top (required)>'
         4: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/ruby-prof-1.3.0-x64-mingw32/lib/ruby-prof.rb:8:in `rescue in <top (required)>'
         3: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require'
         2: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:291:in `load_dependency'
         1: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `block in require'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require': cannot load such file -- ruby_prof.so (LoadError)

Windows 10
Ruby: ruby 2.6.5p114 (2019-10-01 revision 67812) [x64-mingw32]
Rails: Rails 6.0.2.1

There's a ruby_prof.so in ruby-prof-1.2.0/lib but not in ruby-prof-1.3.0-x64-mingw32/lib.

@ghost
Copy link

ghost commented Mar 5, 2020

I can confirm the same issue on Ruby 2.5.7p206 in Windows 10. When I look at Ruby\lib\ruby\gems\2.5.0\gems\ruby-prof-1.3.0-x64-mingw32\ext\ruby_prof I do not see any .o files or ruby_prof.so so it appears that nothing is getting built when it gets installed.

@cfis
Copy link
Member

cfis commented Mar 12, 2020

Right, the mingw version should include a pre-built binary. Looks like that didn't happen for some reason. Will need to push out a 1.4 build.

@cfis
Copy link
Member

cfis commented Mar 12, 2020

And done.

@cfis cfis closed this as completed Mar 12, 2020
@the-nw1-group
Copy link
Author

the-nw1-group commented Apr 14, 2020

Hi

Can I reopen this again? On upgrading to ruby 2.6.6, we're getting the same error again. It seems the ruby-prof.so file is in ruby version specific folder: <ruby-root>\lib\ruby\gems\2.6.0\gems\ruby-prof-1.3.1-x64-mingw32\lib\2.6.5.

Renaming the folder to 2.6.6 get's past the issue, as does moving ruby_prof.so into the parent folder, but I'm not sure that's the best way to fix it.

cfis added a commit that referenced this issue Apr 20, 2020
@markstanley-nps
Copy link

We have just hit this problem or a variant of it upgrading to 1.4.1. We are on ruby ruby 2.6.6p146 (2020-03-31 revision 67876) [x64-mingw32].

Following the upgrade to 1.4.1 under \lib\ruby\gems\2.6.0\gems\ruby-prof-1.4.1-x64-mingw32\lib we only have a 2.7 directory with a ruby_prof.so in it there is no 2.6 directory.

When running rake we then see
rake aborted!
LoadError: cannot load such file -- ruby_prof.so
...
Caused by:
LoadError: cannot load such file -- 2.6/ruby_prof.so

@cfis
Copy link
Member

cfis commented May 26, 2020

Yeah, now that 2.7 has been out 5 months I just pre-built a library for 2.7 (I don't have Ruby 2.6.* installed anymore).

If you install the gem using --platform ruby then the appropriate version of the library will be built. ruby-prof doesn't have any dependencies except Ruby itself, so assuming you have devkit on mingw64 it should work fine.

Hope that works - if not let me know.

@markstanley-nps
Copy link

Thanks that has worked. Much appreciated

We use bundler so I had to use --platform ruby with gem install as you suggested, then tell bundler to upgrade using the --local flag. There may be a more elegant way but it has worked.

@cfis
Copy link
Member

cfis commented May 28, 2020

Ah yeah, good point. There probably is some way in the ruby-prof gemspec to tell bundler that the mingw version only support 2.7 now to avoid this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants