Comments (6)
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.
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.
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.
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.
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.
I'm using Apple M1 Pro btw
from asdf-ruby.
Related Issues (20)
- Can't install truffleruby+graalvm on AlpineLinux HOT 1
- Failed to install Ruby 3.1.4 on Ubuntu 22.04
- Issue installing ruby 3.2.X HOT 1
- Failed to install ruby 3.2.1 on M1 Pro with macOS Ventura 13.3 and macOS 14.0
- Observe ASDF_CONCURRENCY HOT 3
- rbenv install faild with whitespace in `$ASDF_DATA_DIR`
- Getting BUILD FAILED (macOS 13.2.1 on arm64 using ruby-build 20231114) using M2 Macbook on Ventura 13.2.1 HOT 2
- Failed to upgrade Ruby version from 3.2.2 to 3.3.0 using asdf HOT 2
- build fail for ruby 3.3.0 on Apple M2 Max silicone and sonoma 14.2.1 (23C71) HOT 2
- Add Ruby 3.2.3 HOT 2
- asdf does not seem to be picking up on ruby gem executables in the GEM_PATH HOT 7
- "Downloaded files will not be preserved." HOT 1
- Ruby 3.2.3 cannot be installed on Ubuntu 22.04 HOT 1
- Build failed: `psych` Could not be configured. It will not be installed. HOT 3
- Truffle Ruby Latest? HOT 1
- The same OS and asdf version on 2 different machines shows different recent ruby versions to install HOT 4
- asdf in background HOT 4
- Question: can the same version be installed twice with diff name? HOT 3
- Auto-reshim is broken when using the asdf-alias plugin
- Failed to install ruby 3.1.5 on Mac OS 13.6.6 M2 Pro
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asdf-ruby.