GithubHelp home page GithubHelp logo

Comments (6)

phuongnd08 avatar phuongnd08 commented on July 1, 2024 3

After work with @monfresh, I was told that I have probably incorrectly installed a x86 package in brew arm. I nuked my brew packages, correctly activate brew arm and reinstall ruby 3.1.2 and it just works. So the above error probably indicates x86 package being installed in arm environment.

from asdf-ruby.

pboling avatar pboling commented on July 1, 2024

Try using the latest version of ruby-build via (from README example):

ASDF_RUBY_BUILD_VERSION=master asdf install ruby 3.1.2

from asdf-ruby.

phuongnd08 avatar phuongnd08 commented on July 1, 2024

Try using the latest version of ruby-build via (from README example):

ASDF_RUBY_BUILD_VERSION=master asdf install ruby 3.1.2

Still error:

compiling tracepoint.c
compiling enc_associate.c
compiling new.c
compiling enc_str_buf_cat.c
compiling at_exit.c
linking shared-object -test-/typeddata.bundle
compiling fstring.c
compiling wait.c
linking shared-object -test-/tracepoint.bundle
compiling init.c
linking shared-object -test-/time.bundle
compiling modify.c
linking shared-object -test-/vm/at_exit.bundle
compiling bigdecimal.c
compiling escape.c
compiling continuation.c
linking shared-object -test-/wait.bundle
compiling new.c
compiling nofree.c
compiling normalize.c
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:127:1: error: static declaration of 'rb_rational_num' follows non-static declaration
rb_rational_num(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:128:7: note: previous declaration is here
VALUE rb_rational_num(VALUE rat);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:139:1: error: static declaration of 'rb_rational_den' follows non-static declaration
rb_rational_den(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:138:7: note: previous declaration is here
VALUE rb_rational_den(VALUE rat);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:153:1: error: static declaration of 'rb_complex_real' follows non-static declaration
rb_complex_real(VALUE cmp)
^
../.././include/ruby/internal/intern/complex.h:101:7: note: previous declaration is here
VALUE rb_complex_real(VALUE z);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:165:1: error: static declaration of 'rb_complex_imag' follows non-static declaration
rb_complex_imag(VALUE cmp)
^
../.././include/ruby/internal/intern/complex.h:110:7: note: previous declaration is here
VALUE rb_complex_imag(VALUE z);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:189:1: error: redefinition of 'rb_array_const_ptr'
rb_array_const_ptr(VALUE a)
^
../.././include/ruby/internal/core/rarray.h:393:1: note: previous definition is here
rb_array_const_ptr(VALUE a)
^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:208:1: error: static declaration of 'rb_sym2str' follows non-static declaration
rb_sym2str(VALUE sym)
^
../.././include/ruby/internal/symbol.h:211:7: note: previous declaration is here
VALUE rb_sym2str(VALUE id);
      ^
compiling coverage.c
linking shared-object continuation.bundle
bigdecimal.c:6943:18: warning: variable 'prec' set but not used [-Wunused-but-set-variable]
    SIGNED_VALUE prec;
                 ^
1 warning and 6 errors generated.
compiling qsort.c
make[2]: *** [bigdecimal.o] Error 1
make[1]: *** [ext/bigdecimal/all] Error 2
make[1]: *** Waiting for unfinished jobs....
compiling rb_interned_str.c
installing default coverage libraries
compiling date_core.c
compiling rb_str_dup.c
compiling set_len.c
linking shared-object cgi/escape.bundle
compiling date_parse.c
compiling date_strftime.c
linking shared-object coverage.bundle
compiling date_strptime.c
linking shared-object -test-/string.bundle
In file included from date_parse.c:362:
zonetab.list:6:27: warning: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static const struct zone *zonetab();
                          ^
                                  void
zonetab.list:774:1: warning: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
zonetab (register const char *str, register size_t len)
^
2 warnings generated.
linking shared-object date_core.bundle
make: *** [build-ext] Error 2

from asdf-ruby.

pboling avatar pboling commented on July 1, 2024

IMO, you must be missing some of the pre-requisites. This tool does not install (many of) them for you, so (most) libraries that must be linked against need to be already installed.

I am not sure which things specifically I needed, because I always install a bunch of things from homebrew, and then I don't have any issues installing Ruby.

On one recent project (you probably don't need all of these):

brew install bash coreutils grep readline cmake gcc xz zlib autoconf automake snappy glib vips redis memcached mysql git

from asdf-ruby.

phuongnd08 avatar phuongnd08 commented on July 1, 2024

Looks like the error coming from how the compiler understanding the syntax used in bigdecimal source code, no?
I tried the brew install but it doesn't do anything on my machine (except printing more instructions):

% brew install bash coreutils grep readline cmake gcc xz zlib autoconf automake snappy glib vips redis memcached mysql git
Warning: Treating cmake as a formula. For the cask, use homebrew/cask/cmake
Warning: Treating snappy as a formula. For the cask, use homebrew/cask/snappy
Warning: readline 8.1.2 is already installed and up-to-date.
To reinstall 8.1.2, run:
  brew reinstall readline
Warning: cmake 3.22.2 is already installed and up-to-date.
To reinstall 3.22.2, run:
  brew reinstall cmake
Warning: xz 5.2.5 is already installed and up-to-date.
To reinstall 5.2.5, run:
  brew reinstall xz
Warning: autoconf 2.71 is already installed, it's just not linked.
To link this version, run:
  brew link autoconf
Warning: automake 1.16.5 is already installed and up-to-date.
To reinstall 1.16.5, run:
  brew reinstall automake
Warning: snappy 1.1.9 is already installed and up-to-date.
To reinstall 1.1.9, run:
  brew reinstall snappy
Warning: glib 2.70.4 is already installed and up-to-date.
To reinstall 2.70.4, run:
  brew reinstall glib
redis 6.2.1 is already installed but outdated (so it will be upgraded).
memcached 1.6.9 is already installed but outdated (so it will be upgraded).
git 2.31.1 is already installed but outdated (so it will be upgraded).
Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)!
Please create a new installation in /opt/homebrew using one of the
"Alternative Installs" from:
  https://docs.brew.sh/Installation
You can migrate your previously installed formula list with:
  brew bundle dump

from asdf-ruby.

phuongnd08 avatar phuongnd08 commented on July 1, 2024

I'm using Apple M1 Pro btw

from asdf-ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.