A broad look into the Apple M1 from the perspective of a Ruby Developer. We look at a lot of the different aspects; Docker, asdf Ruby, Visual Studio Code, and more.
development
rails
12:35
UPDATE Feb 2021: I've been using the M1 with Docker successfully and it has been a great experience. At this point I would probably hold off until their next version as it will likely be much faster. However, if you're in a pinch and need something now. A 16GB RAM version would be the way to go. I've head of many who got the 8GB version and wish they had gone with 16GB. You can get started with Docker on the M1 at https://docs.docker.com/docker-for-mac/apple-m1/
UPDATE April 2021: I've been using HomeBrew without specifying the x86 Arch for some time now and it's been very stable.
gem install rails
rails new template
rails db:system:change --to=postgresql
Update
I've been testing things further with an alternative method of Homebrew installation. This will allow for packages to be installed to the arm64 instead of forcing them through Rosetta2. The benefit of this is that libraries like RVM and asdf will use Homebrew to install dependencies. Now, with the dependencies being installed for arm64 instead of Rosetta2, we can install and compile Ruby for arm.
If you're now having issues with brew installs, you can try to add the -s flag which will download from source even if a package is available.
brew install -s PROGRAM_NAME
If you're going to be using Ruby on Rails, there is an issue with the FFI library where you will need to pull from master. This is accurate for the 1.13.1 version of FFI. You can add this to the Gemfile
gem 'ffi', github: 'ffi/ffi'
# or
gem 'ffi', git: 'https://github.com/ffi/ffi.git'
You'll need to install node from source.
brew install wget
wget https://nodejs.org/download/release/latest/node-v15.3.0.tar.gz
tar zxf node-v15.3.0.tar.gz
cd node-v15.3.0
./configure; make
sudo make install
sudo npm -g install yarn
The results are amazing. HOWEVER, I just cannot recommend this approach at this moment until things get ironed out. There are still too many issues and compatibility problems with the Ruby ARM Version. I've found a few crashes and it's just not stable enough. For now, continue to use the Ruby x86 version.