-
Notifications
You must be signed in to change notification settings - Fork 383
Installing therubyracer on Mac OS and Ruby 2.3.0 #266
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
Comments
Thanks for this. Saved me a headache. |
Thanks a lot. I tried this before but somehow v8-315 was not downloading. I think they relinked the same :) |
Worked for me as well although I had to change the
Thanks! |
MacOS Mojave brew update on my computer, libv8_path is /usr/local/Cellar/v8/7.2.502.25 |
In my case I had to use |
I still seem to be having this issue even after following all of the steps above:
yields:
I also tried with the |
This answer https://stackoverflow.com/a/25757171/6186921 worked for me. MacOS Mojave.
|
Using homebrew's directory of v8 for This is visible in the |
Same as previous comment, with specifying in addition the required version, as such: |
I have tried all above mentioned but nothing did work. But updating bundle update mini_racer It updates the version of libv8 from In my case, bundle was stuck at this point for more than 30 mins even after multiple tries Also raised the PR: #466 |
This works for me, thanks! |
This works perfect! thanks |
Hi there - I am following https://stackoverflow.com/questions/65810530/unable-to-install-therubyracer-v0-12-3-gem-in-m1-macbook-pro with interest as I have the same issue - getting ruby racer working on apple m1 silicon. I can see:
I can see that v8 is installed and present:
I can also try to use this path which I have seen as a fix for some people:
... so seem to be stumped. Has anyone succeed on getting ruby racer working on apple silicon? Kind regards, Steve. |
@stevenjohn I recommend posting what you just posted to the therubyracer and mini_racer gems. |
Thanks @justin808 |
I tried step by step, but it still failed. My laptop and the failure detail: bdu@CHEMMS-bdu ~ $ brew update [system]
Already up-to-date.
bdu@CHEMMS-bdu ~ $ brew install v8 [system]
==> Downloading https://ghcr.io/v2/homebrew/core/v8/manifests/9.8.177.9
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/v8/blobs/sha256:122e44b93947e782b559967cfbadcc422b0781bf2507f50b994ab7a629ad735f
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:122e44b93947e782b559967cfbadcc422b0781bf2507f50b994ab7a629ad735f?se=2022-02-13T04%3A00%3A00Z&sig=ff40UMcfJFTloqITRkxToaGwmEjiXaEiW1ablGThrKw%3D&sp=r&spr=https&sr=b&sv=2019-12-12
######################################################################## 100.0%
==> Pouring v8--9.8.177.9.arm64_monterey.bottle.tar.gz
🍺 /opt/homebrew/Cellar/v8/9.8.177.9: 200 files, 43MB
==> Running `brew cleanup v8`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
bdu@CHEMMS-bdu ~ $ gem install libv8 -v '3.16.14.15' -- --with-system-v8 [system]
Fetching libv8-3.16.14.15.gem
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
bdu@CHEMMS-bdu ~ $ sudo gem install libv8 -v '3.16.14.15' -- --with-system-v8 [system]
Password:
Fetching libv8-3.16.14.15.gem
Building native extensions with: '--with-system-v8'
This could take a while...
Successfully installed libv8-3.16.14.15
1 gem installed
bdu@CHEMMS-bdu ~ $ gem install therubyracer -v '0.12.3' -- --with-v8-dir=/usr/local/opt/[email protected] [system]
bdu@CHEMMS-bdu ~ $ cd /usr/local/opt/v [system]
bdu@CHEMMS-bdu ~ $ cd /usr/local/Cellar/ [system]
bdu@CHEMMS-bdu ~ $ gem install therubyracer -- --with-v8-dir=/opt/homebrew/Cellar/v8/9.8.177.9 [system]
Fetching therubyracer-0.12.3.gem
Fetching ref-2.0.0.gem
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
bdu@CHEMMS-bdu ~ $ sudo gem install therubyracer -- --with-v8-dir=/opt/homebrew/Cellar/v8/9.8.177.9 [system]
Fetching therubyracer-0.12.3.gem
Fetching ref-2.0.0.gem
Successfully installed ref-2.0.0
Building native extensions with: '--with-v8-dir=/opt/homebrew/Cellar/v8/9.8.177.9'
This could take a while...
ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/therubyracer-0.12.3/ext/v8
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20220213-85625-ezs873.rb extconf.rb --with-v8-dir\=/opt/homebrew/Cellar/v8/9.8.177.9
checking for -lpthread... yes
checking for -lobjc... yes
checking for v8.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
--with-pthreadlib
--without-pthreadlib
--with-objclib
--without-objclib
--enable-debug
--disable-debug
--with-v8-dir
--with-v8-include
--without-v8-include=${v8-dir}/include
--with-v8-lib
--without-v8-lib=${v8-dir}/lib
/Library/Ruby/Gems/2.6.0/gems/libv8-3.16.14.15/ext/libv8/location.rb:50:in `configure': By using --with-system-v8, you have chosen to use the version (Libv8::Location::System::NotFoundError)
of V8 found on your system and *not* the one that is bundled with
the libv8 rubygem.
However, your system version of v8 could not be located.
Please make sure your system version of v8 that is compatible
with 3.16.14.15 installed. You may need to use the
--with-v8-dir option if it is installed in a non-standard location
from /Library/Ruby/Gems/2.6.0/gems/libv8-3.16.14.15/lib/libv8.rb:7:in `configure_makefile'
from extconf.rb:32:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Library/Ruby/Gems/2.6.0/extensions/universal-darwin-21/2.6.0/therubyracer-0.12.3/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/therubyracer-0.12.3 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-21/2.6.0/therubyracer-0.12.3/gem_make.out |
On MacOS Mojave this works: install [email protected] edit profile(in my case vi ~/.zshrc) and add this:
install therubyracer version in this case 0.12.2: Hope this will work. |
If you have the below problem, the solution that worked for me on April 3, 2016 can be found here:
http://stackoverflow.com/a/36388150/1009332
Errors that this fixes:
The text was updated successfully, but these errors were encountered: