I'm trying to get Ruby on Rails running in a Docker on an Apple Silicon (M1) Macbook. The problem I'm having is the Javascript runtime. The gem mini_racer depends on libv8 which does not install properly. People having similar issues seems to either compile V8 from source and force libv8/mini_racer to use the system version. The other path seem to be to use NodeJS instead.
Has anyone gotten RoR with Javascript runtime up and running in Docker on a M1 chip?
As I remember seem it is not about M1 but mini_racer has some issues with libv8, but it usualy on mac we use to do following to solve issue
brew tap homebrew/versions
brew install v8-315
gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
bundle install
but not sure why it is happening on your docker, another way is check where is v8 installed and change the --with url with that path.
In docker before error commit further lines, and let build done, then you can ssh in, and try to local command. Someone suggested following solution.
RUN gem install -N libv8 -v '3.16.14.13' -- --with-system-v8 \
&& bundle config --global build.libv8 --with-system-v8
You may share your dockerfile so first we can confirm it is working on normal machine and then you can try out. But of course M1 is different architecture and some programmes are not ready for it yet.
What I can say from a V8 perspective is:
(I'm not familiar with RoR or Docker, so I can't help with the specifics regarding those.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With