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

Remote server (heroku) crashes when loading xirr gem #10

Open
marcusteam5 opened this issue Oct 4, 2018 · 8 comments
Open

Remote server (heroku) crashes when loading xirr gem #10

marcusteam5 opened this issue Oct 4, 2018 · 8 comments

Comments

@marcusteam5
Copy link

First of all great gem! Love how flawless this runs on my machine. The calculation seem even more smooth than excels calculation of xirr.

I have troubles deploying it to heroku however. It runs smoothly in my local environment on Ruby 2.4.1. The server at Heroku however crashes when trying to load this gem.

Heroku is not the first host to fail at this. I had it on a vps server at a2hosting.com, which also crashed and wasn't able to load the gem. Once I disabled it my app was fine. So I am pretty sure it is not due to the specific environment of heroku. Without this gem my app runs remotely.

I would really like to use this gem, also remotely, please help! Thanks.

Here are the logs: (Please note that the crash happens at 2018-10-04T14:00:58.317322+00:00 heroku[web.1]: )

2018-10-04T13:52:07.440125+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
2018-10-04T13:52:07.440127+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
2018-10-04T13:52:07.440128+00:00 app[web.1]: from bin/rails:9:in `<main>'
2018-10-04T14:00:38.937632+00:00 heroku[web.1]: State changed from crashed to starting
2018-10-04T14:00:53.448485+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 26231 -e production`
2018-10-04T14:00:58.317322+00:00 heroku[web.1]: State changed from starting to crashed
2018-10-04T14:00:58.303498+00:00 heroku[web.1]: Process exited with status 1
2018-10-04T14:00:58.245064+00:00 app[web.1]: sh: 1: gcc: not found
2018-10-04T14:00:58.245583+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:85:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'xirr'. (Bundler::GemRequireError)
2018-10-04T14:00:58.245589+00:00 app[web.1]: Gem Load Error is: error executing "gcc -shared  -Wl,--compress-debug-sections=zlib -fPIC -O3 -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wimplicit-fallthrough=0 -L. -fstack-protector -rdynamic -Wl,-export-dynamic -I /app/vendor/ruby-2.4.1/include/ruby-2.4.0 -I /app/vendor/ruby-2.4.1/include/ruby-2.4.0/x86_64-linux -I /app/vendor/ruby-2.4.1/include -L/app/vendor/ruby-2.4.1/lib -o \"/app/.ruby_inline/ruby-2.4.0/Inline_Xirr__Base_e5418cc7a0340a20b564219237faf166.so\" \"/app/.ruby_inline/ruby-2.4.0/Inline_Xirr__Base_e5418cc7a0340a20b564219237faf166.c\"  ": pid 8 exit 127
2018-10-04T14:00:58.245622+00:00 app[web.1]: Renamed /app/.ruby_inline/ruby-2.4.0/Inline_Xirr__Base_e5418cc7a0340a20b564219237faf166.c to /app/.ruby_inline/ruby-2.4.0/Inline_Xirr__Base_e5418cc7a0340a20b564219237faf166.c.bad
2018-10-04T14:00:58.245625+00:00 app[web.1]: Backtrace for gem load error is:
2018-10-04T14:00:58.245627+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/RubyInline-3.12.4/lib/inline.rb:618:in `build'
2018-10-04T14:00:58.245628+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/RubyInline-3.12.4/lib/inline.rb:856:in `inline'
2018-10-04T14:00:58.245630+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/xirr-0.6.0/lib/xirr/base.rb:31:in `<module:Base>'
2018-10-04T14:00:58.245631+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/xirr-0.6.0/lib/xirr/base.rb:4:in `<module:Xirr>'
2018-10-04T14:00:58.245633+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/xirr-0.6.0/lib/xirr/base.rb:1:in `<main>'
2018-10-04T14:00:58.245635+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
2018-10-04T14:00:58.245641+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
2018-10-04T14:00:58.245643+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
2018-10-04T14:00:58.245644+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
2018-10-04T14:00:58.245645+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
2018-10-04T14:00:58.245646+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
2018-10-04T14:00:58.245647+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
2018-10-04T14:00:58.245650+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
2018-10-04T14:00:58.245648+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
2018-10-04T14:00:58.245649+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/xirr-0.6.0/lib/xirr.rb:6:in `<main>'
2018-10-04T14:00:58.245651+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
2018-10-04T14:00:58.245652+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
2018-10-04T14:00:58.245653+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
2018-10-04T14:00:58.245654+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
2018-10-04T14:00:58.245655+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:82:in `block (2 levels) in require'
2018-10-04T14:00:58.245656+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:77:in `each'
2018-10-04T14:00:58.245657+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:77:in `block in require'
2018-10-04T14:00:58.245658+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:66:in `each'
2018-10-04T14:00:58.245659+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:66:in `require'
2018-10-04T14:00:58.245660+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler.rb:108:in `require'
2018-10-04T14:00:58.245661+00:00 app[web.1]: /app/config/application.rb:7:in `<main>'
2018-10-04T14:00:58.245662+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
2018-10-04T14:00:58.245668+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
2018-10-04T14:00:58.245669+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
2018-10-04T14:00:58.245670+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
2018-10-04T14:00:58.245671+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
2018-10-04T14:00:58.245672+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
2018-10-04T14:00:58.245673+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
2018-10-04T14:00:58.245674+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
2018-10-04T14:00:58.245675+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:145:in `block in perform'
2018-10-04T14:00:58.245676+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:142:in `tap'
2018-10-04T14:00:58.245676+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:142:in `perform'
2018-10-04T14:00:58.245677+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
2018-10-04T14:00:58.245678+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
2018-10-04T14:00:58.245679+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
2018-10-04T14:00:58.245680+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/command/base.rb:65:in `perform'
2018-10-04T14:00:58.245681+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/command.rb:46:in `invoke'
2018-10-04T14:00:58.245682+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/commands.rb:18:in `<main>'
2018-10-04T14:00:58.245683+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
2018-10-04T14:00:58.245684+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
2018-10-04T14:00:58.245685+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
2018-10-04T14:00:58.245686+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
2018-10-04T14:00:58.245687+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
2018-10-04T14:00:58.245688+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
2018-10-04T14:00:58.245689+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
2018-10-04T14:00:58.245690+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
2018-10-04T14:00:58.245691+00:00 app[web.1]: bin/rails:9:in `<main>'
2018-10-04T14:00:58.245692+00:00 app[web.1]: Bundler Error Backtrace:
2018-10-04T14:00:58.245693+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
2018-10-04T14:00:58.245694+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:77:in `each'
2018-10-04T14:00:58.245695+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:77:in `block in require'
2018-10-04T14:00:58.245696+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:66:in `each'
2018-10-04T14:00:58.245698+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:66:in `require'
2018-10-04T14:00:58.245698+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler.rb:108:in `require'
2018-10-04T14:00:58.245699+00:00 app[web.1]: from /app/config/application.rb:7:in `<main>'
2018-10-04T14:00:58.245700+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
2018-10-04T14:00:58.245701+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
2018-10-04T14:00:58.245702+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
2018-10-04T14:00:58.245704+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
2018-10-04T14:00:58.245705+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
2018-10-04T14:00:58.245706+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
2018-10-04T14:00:58.245707+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
2018-10-04T14:00:58.245710+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
2018-10-04T14:00:58.245711+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:145:in `block in perform'
2018-10-04T14:00:58.245712+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:142:in `tap'
2018-10-04T14:00:58.245713+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/commands/server/server_command.rb:142:in `perform'
2018-10-04T14:00:58.245714+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
2018-10-04T14:00:58.245715+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
2018-10-04T14:00:58.245716+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
2018-10-04T14:00:58.245718+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/command/base.rb:65:in `perform'
2018-10-04T14:00:58.245721+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/command.rb:46:in `invoke'
2018-10-04T14:00:58.245723+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/commands.rb:18:in `<main>'
2018-10-04T14:00:58.245724+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
2018-10-04T14:00:58.245725+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
2018-10-04T14:00:58.245727+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
2018-10-04T14:00:58.245730+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
2018-10-04T14:00:58.245734+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
2018-10-04T14:00:58.245737+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
2018-10-04T14:00:58.245738+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
2018-10-04T14:00:58.245744+00:00 app[web.1]: from bin/rails:9:in `<main>'
2018-10-04T14:00:58.245741+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
2018-10-04T14:01:03.346945+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=inventory2-180924.herokuapp.com request_id=a6550ebc-ed79-48a2-81fb-2404cb71efa0 fwd="87.151.1.121" dyno= connect= service= status=503 bytes= protocol=https
@tubedude
Copy link
Owner

tubedude commented Oct 4, 2018

You must be running on the new Heroku stack, right? It does not allow the inline dependency.
Here is the issue. Ruby is slow to calculate IRR, so I've added this function in C to make it faster.
The new Heroku stack has removed GCC which compiles this C function .
in your log:

2018-10-04T14:00:58.245064+00:00 app[web.1]: sh: 1: gcc: not found

The work around is to your the old stack. Or use the no-inline branch. Try it to see if your results are fast enough.

@marcusteam5
Copy link
Author

How can I get the old stack on Heroku with C support? I would like to continue having the same speed, which is wonderful. Sorry, I'm a total noob at this.

@marcusteam5
Copy link
Author

Thanks for your help first of all.

@fmoudoute
Copy link

@marcusteam5 could you go around that problem ?
I am facing the same issue. The problem seems well known but there is little explanation on how to deal with it.

@tubedude
Copy link
Owner

tubedude commented Dec 4, 2018

@fmoudoute one work around is to use the no_inline branch. I think it will work on newer Heroku stacks.

@dinosimone
Copy link

no_inline branch on Heroku Stack 18 worked for me. Thank you.

@djdarkbeat
Copy link

djdarkbeat commented Aug 1, 2019

Confirmed issue on Heroku-18:

2019-07-31T17:36:39.636144+00:00 app[worker.1]: Bundler::GemRequireError: There was an error while trying to load the gem 'xirr'.
2019-07-31T17:36:39.636147+00:00 app[worker.1]: Gem Load Error is: error executing "gcc -shared  -Wl,--compress-debug-sections=zlib -fPIC -O3 -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict  -fPIC -L. -fstack-protector -rdynamic -Wl,-export-dynamic -I /app/vendor/ruby-2.5.3/include/ruby-2.5.0 -I /app/vendor/ruby-2.5.3/include/ruby-2.5.0/x86_64-linux -I /app/vendor/ruby-2.5.3/include -L/app/vendor/ruby-2.5.3/lib -o \"/app/.ruby_inline/ruby-2.5.0/Inline_Xirr__Base_e5418cc7a0340a20b564219237faf166.so\" \"/app/.ruby_inline/ruby-2.5.0/Inline_Xirr__Base_e5418cc7a0340a20b564219237faf166.c\"  ": pid 8 exit 1
2019-07-31T17:36:39.636160+00:00 app[worker.1]: Renamed /app/.ruby_inline/ruby-2.5.0/Inline_Xirr__Base_e5418cc7a0340a20b564219237faf166.c to /app/.ruby_inline/ruby-2.5.0/Inline_Xirr__Base_e5418cc7a0340a20b564219237faf166.c.bad

Resolution was to use the no_inline branch. Works. Probably can close this issue.

@m94h
Copy link

m94h commented Mar 22, 2021

Unfortunately using no_inline branch approach was too slow for our rails app.
We developed a heroku buildpack for this issue.
Our approach was to compile a c executable binary with this buildpack and make a monkey patch on this gem.

# frozen_string_literal: true

module Xirr
  module Base
    alias_method :original_xnpv_c, :xnpv_c

    def xnpv_c(rate, amount, period)
      return original_xnpv_c(rate, amount, period) unless Rails.env.production?

      `xirr #{rate} #{amount} #{period}`.to_f
    end
  end
end

Hope this can help developers facing the same issue.

Repository owner deleted a comment from yogeshkushwahait Feb 23, 2024
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

5 participants