ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Failure to load required rubycdapi26.so file
Posted by David Bechtel on Aug-05-2021 21:17
When I attempt to run the anglepie.rb file or any other in this new setup, I get the following error.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:Usersbrians>cd appchartdirectorrubydemo

C:AppChartDirectorrubydemo>ruby anglepie.rb
C:/Ruby26-x64/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': 193: %1 is not a valid Win32 applicati
on.   - C:/Ruby26-x64/lib/ruby/site_ruby/2.6.0/rubycdapi26.so (LoadError)
        from C:/Ruby26-x64/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby26-x64/lib/ruby/site_ruby/2.6.0/chartdirector.rb:27:in `rescue in <module:ChartDirector>'
        from C:/Ruby26-x64/lib/ruby/site_ruby/2.6.0/chartdirector.rb:24:in `<module:ChartDirector>'
        from C:/Ruby26-x64/lib/ruby/site_ruby/2.6.0/chartdirector.rb:1:in `<top (required)>'
        from C:/Ruby26-x64/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby26-x64/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from anglepie.rb:2:in `<main>'
C:/Ruby26-x64/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': 193: %1 is not a valid Win32 applicati
on.   - C:/Ruby26-x64/lib/ruby/site_ruby/2.6.0/rubycdapi26.so (LoadError)
        from C:/Ruby26-x64/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby26-x64/lib/ruby/site_ruby/2.6.0/chartdirector.rb:25:in `<module:ChartDirector>'
        from C:/Ruby26-x64/lib/ruby/site_ruby/2.6.0/chartdirector.rb:1:in `<top (required)>'
        from C:/Ruby26-x64/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby26-x64/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from anglepie.rb:2:in `<main>'

C:AppChartDirectorrubydemo>

  Re: Failure to load required rubycdapi26.so file
Posted by David Bechtel on Aug-05-2021 21:57
I found information in other forum areas that I needed to be using 32 bit Ruby, so I uninstalled the 64 bit version, cleared out all of its files and installed 2.6.8 version x86 (32 bit) and got a simpler, but similar error message regarding not being able to load the file.


C:AppChartDirectorrubydemo>ruby --version
ruby 2.6.8p205 (2021-07-07 revision 67951) [i386-mingw32]

C:AppChartDirectorrubydemo>
C:AppChartDirectorrubydemo>ruby anglepie.rb
C:/Ruby26/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- chartdirector (Lo
adError)
        from C:/Ruby26/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from anglepie.rb:2:in `<main>'

C:AppChartDirectorrubydemo>

  Re: Failure to load required rubycdapi26.so file
Posted by Peter Kwan on Aug-05-2021 23:17
Hi David,

The error message "cannot load such file -- chartdirector (LoadError)" usually means that the ruby cannot find the "chartdirector.rb" file.

When you execute the "ruby install.rb" that comes with ChartDirector, it should copy the "chartdirector.rb" and all the ChartDirector shared objects/DLL to a folder in the ruby search path. The ruby should then be able to find the "chartdirector.rb". Have you run the "ruby install.rb" using the 32-bit ruby?

The actual chartdirector.rb and the *.so and *.dll files are in "ChartDirectorrailsdemovendor" of the download. May be you can try to copy the *.rb, *.so and *.dll in that folder to the current directory (eg. the "rubydemo" directory), and then use:

ruby -I. anglepie.rb

If this works, then it is an installation issue. May be the "install.rb" is unable to determine the correct folder to copy the files to so that they can be located by the ruby. May be the "install.rb" is confused which folder to use when there are multiple ruby installations in the machine.

Regards
Peter Kwan

  Re: Failure to load required rubycdapi26.so file
Posted by David Bechtel on Aug-06-2021 01:09
Thank you. That was the issue.  I had been installing and uninstalling Ruby versions trying to get things working, and forgot to reinstall ChartDirector.  I have it working now.
Thanks for your help.

  Re: Failure to load required rubycdapi26.so file
Posted by David Bechtel on Aug-13-2021 21:18
Sorry, a new variation on the same issue:

I have the path proper, I can run irb from either the source or the destination locations where the files are and still get an error that it cannot find the file.

From Source directory...

C:AppChartDirectorrailsdemovendor>ruby
^Z^C
C:AppChartDirectorrailsdemovendor>
C:AppChartDirectorrailsdemovendor>
C:AppChartDirectorrailsdemovendor>irb
irb(main):001:0> require './rubycdapi26.so'
Traceback (most recent call last):
        6: from C:/Ruby27/bin/irb.cmd:31:in `<main>'
        5: from C:/Ruby27/bin/irb.cmd:31:in `load'
        4: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/irb-1.2.6/exe/irb:11:in `<top (required)>'
        3: from (irb):1
        2: from C:/Ruby27/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        1: from C:/Ruby27/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
LoadError (126: The specified module could not be found.   - C:/App/ChartDirector/railsdemo/vendor/rubycdapi26.so)
irb(main):002:0> require './chartdirector'
Traceback (most recent call last):
       12: from C:/Ruby27/bin/irb.cmd:31:in `<main>'
       11: from C:/Ruby27/bin/irb.cmd:31:in `load'
       10: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/irb-1.2.6/exe/irb:11:in `<top (required)>'
        9: from (irb):1
        8: from (irb):2:in `rescue in irb_binding'
        7: from C:/Ruby27/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        6: from C:/Ruby27/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        5: from C:/App/ChartDirector/railsdemo/vendor/chartdirector.rb:1:in `<top (required)>'
        4: from C:/App/ChartDirector/railsdemo/vendor/chartdirector.rb:24:in `<module:ChartDirector>'
        3: from C:/App/ChartDirector/railsdemo/vendor/chartdirector.rb:27:in `rescue in <module:ChartDirector>'
        2: from C:/Ruby27/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        1: from C:/Ruby27/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
LoadError (126: The specified module could not be found.   - C:/Ruby27/lib/ruby/site_ruby/2.7.0/rubycdapi26.so)
irb(main):003:0> exit

C:AppChartDirectorrailsdemovendor>dir c:/ruby27/lib/ruby/site_ruby/2.7.0/*.so
Parameter format not correct - "ruby27".

C:AppChartDirectorrailsdemovendor>dir c:ruby27librubysite_ruby2.7.0*.so
Volume in drive C has no label.
Volume Serial Number is 90FF-E363

Directory of c:ruby27librubysite_ruby2.7.0

08/12/2021  04:19 PM            20,480 rubycdapi18.so
08/12/2021  04:19 PM            24,576 rubycdapi191.so
08/12/2021  04:19 PM            31,744 rubycdapi20.so
08/12/2021  04:19 PM            32,256 rubycdapi21.so
08/12/2021  04:19 PM            31,744 rubycdapi22.so
08/12/2021  04:19 PM            20,992 rubycdapi23.so
08/12/2021  04:19 PM            21,504 rubycdapi24.so
08/12/2021  04:19 PM            21,504 rubycdapi25.so
08/12/2021  04:19 PM            22,016 rubycdapi26.so
               9 File(s)        226,816 bytes
               0 Dir(s)  532,094,599,168 bytes free

From the destination location.....

C:Ruby27librubysite_ruby2.7.0>dir
Volume in drive C has no label.
Volume Serial Number is 90FF-E363

Directory of C:Ruby27librubysite_ruby2.7.0

08/12/2021  04:02 PM    <DIR>          .
08/12/2021  04:02 PM    <DIR>          ..
08/12/2021  04:19 PM         2,748,416 chartdir.dll
08/12/2021  04:19 PM            59,042 chartdirector.rb
07/09/2021  07:40 PM                74 devkit.rb
08/12/2021  04:19 PM            96,872 financechart.rb
07/09/2021  07:40 PM               726 irbrc_predefiner.rb
08/12/2021  04:19 PM            20,480 rubycdapi18.so
08/12/2021  04:19 PM            24,576 rubycdapi191.so
08/12/2021  04:19 PM            31,744 rubycdapi20.so
08/12/2021  04:19 PM            32,256 rubycdapi21.so
08/12/2021  04:19 PM            31,744 rubycdapi22.so
08/12/2021  04:19 PM            20,992 rubycdapi23.so
08/12/2021  04:19 PM            21,504 rubycdapi24.so
08/12/2021  04:19 PM            21,504 rubycdapi25.so
08/12/2021  04:19 PM            22,016 rubycdapi26.so
08/09/2021  09:58 AM    <DIR>          ruby_installer
07/09/2021  07:40 PM                71 ruby_installer.rb
              15 File(s)      3,132,017 bytes
               3 Dir(s)  532,093,276,160 bytes free

C:Ruby27librubysite_ruby2.7.0>irb
irb(main):001:0> require './chartdirector'
Traceback (most recent call last):
       11: from C:/Ruby27/bin/irb.cmd:31:in `<main>'
       10: from C:/Ruby27/bin/irb.cmd:31:in `load'
        9: from C:/Ruby27/lib/ruby/gems/2.7.0/gems/irb-1.2.6/exe/irb:11:in `<top (required)>'
        8: from (irb):1
        7: from C:/Ruby27/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        6: from C:/Ruby27/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        5: from C:/Ruby27/lib/ruby/site_ruby/2.7.0/chartdirector.rb:1:in `<top (required)>'
        4: from C:/Ruby27/lib/ruby/site_ruby/2.7.0/chartdirector.rb:24:in `<module:ChartDirector>'
        3: from C:/Ruby27/lib/ruby/site_ruby/2.7.0/chartdirector.rb:27:in `rescue in <module:ChartDirector>'
        2: from C:/Ruby27/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        1: from C:/Ruby27/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
LoadError (126: The specified module could not be found.   - C:/Ruby27/lib/ruby/site_ruby/2.7.0/rubycdapi26.so)
irb(main):002:0>

  Re: Failure to load required rubycdapi26.so file
Posted by Peter Kwan on Aug-14-2021 02:45
Hi David,

ChartDirector for Ruby supports up to Ruby 2.6. You seem to be using Ruby 2.7. It is unlikely to work.

I have just tried to use irb in Ruby 2.6, and it works normally in my machine.

The error "The specified module could not be found" does not necessarily mean that it cannot find the "rubycdapi26.so". It just means it cannot find a module when trying to load "rubycdapi26.so". The module that it fails to find is probably is the MSVCRT-RUBY260.DLL, which is part of Ruby 2.6 and does not exist in Ruby 2.7.

Regards
Peter Kwan

  Re: Failure to load required rubycdapi26.so file
Posted by David Bechtel on Aug-14-2021 04:37
Peter,
  You are the MAN!  I was wasting my time trying to get the so file to load.

  I just uninstalled 2.7 and reinstalled 2.6 with all the dev materials and the files are there.

  ChartDirector works now.

Thank you!

Dave