gem install cannot find a header file

后端 未结 3 1742
深忆病人
深忆病人 2020-12-20 05:18

Following along the github README for talib_ruby:

sudo port install ta-lib

Complete. Next is where the trouble begins.

sudo         


        
相关标签:
3条回答
  • 2020-12-20 05:48

    Observe

    sudo echo $ABSOLUTE_PATH_TO_TALIB_HEADERS

    echo ABSOLUTE_PATH_TO_TALIB_HEADERS

    have included in **my** .bash_profile file the following:
    

    sudo

    Are you root?

    put the env vars on the command line and you should be good, alternatively add them to root's env.

    0 讨论(0)
  • 2020-12-20 05:48

    Just adding an answer for brew installed ta-lib.

    env ARCHFLAGS="-arch x86_64" gem install talib_ruby -- --with-talib-include=/usr/local/include/ta-lib --with-talib-lib=/usr/local/lib

    0 讨论(0)
  • 2020-12-20 05:52

    The answer to this question was answered by the gem author via email, but I'd like to share the solution.

    sudo env ARCHFLAGS="-arch x86_64" gem install talib_ruby -- --with-talib-include=/opt/local/var/macports/software/ta-lib/0.4.0_0/opt/local/include/ta-lib  --with-talib-lib=/opt/local/var/macports/software/ta-lib/0.4.0_0/opt/local/lib
    

    It is important to note that this gem is also not compatible with Ruby 1.9.2. From what the error list generated, it had some issues with the definition of struct RObject (fill in Object with String, Array, etc), which I traced to the ruby.h header file. If you'd like to use this gem, you can install rvm and then type

    rvm install ruby-1.8.7 --with-readline-dir=/opt/local
    

    From there, simply follow the guidance from the gem author with the input listed above.

    UPDATE: the gem author has made talib_ruby compatible with 1.9.x so there is no longer a need to install 1.8.7

    0 讨论(0)
提交回复
热议问题