mirror of
https://github.com/jekyll/jekyll.git
synced 2026-02-16 01:25:24 -05:00
committed by
GitHub
parent
a0d7900bbe
commit
85508ccbf3
@@ -4,7 +4,7 @@ permalink: /docs/installation/macos/
|
||||
---
|
||||
|
||||
## Install Command Line Tools
|
||||
First, you need to install the command-line tools to be able to compile native extensions, open a terminal and run:
|
||||
To install the command line tools to compile native extensions, open a terminal and run:
|
||||
|
||||
```sh
|
||||
xcode-select --install
|
||||
@@ -12,9 +12,10 @@ xcode-select --install
|
||||
|
||||
## Install Ruby
|
||||
|
||||
Jekyll requires **Ruby > {{ site.data.ruby.min_version }}**.
|
||||
macOS Catalina 10.15 comes with ruby 2.6.3, so you're fine.
|
||||
If you're running a previous macOS system, you'll have to install a newer version of Ruby.
|
||||
Jekyll requires **Ruby v{{ site.data.ruby.min_version }}** or higher.
|
||||
macOS Catalina 10.15 ships with Ruby 2.6.3. Check your Ruby version using `ruby -v`.
|
||||
|
||||
If you're running a previous version of macOS, you'll have to install a newer version of Ruby.
|
||||
|
||||
### With Homebrew {#brew}
|
||||
To run the latest Ruby version you need to install it through [Homebrew](https://brew.sh).
|
||||
@@ -26,13 +27,13 @@ To run the latest Ruby version you need to install it through [Homebrew](https:/
|
||||
brew install ruby
|
||||
```
|
||||
|
||||
Add the brew ruby path to your shell config:
|
||||
Add the brew ruby path to your shell configuration:
|
||||
|
||||
```bash
|
||||
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
|
||||
```
|
||||
|
||||
Then relaunch your terminal and check your updated Ruby setup:
|
||||
Relaunch your terminal and check your Ruby setup:
|
||||
|
||||
```sh
|
||||
which ruby
|
||||
@@ -42,7 +43,7 @@ ruby -v
|
||||
{{ site.data.ruby.current_version_output }}
|
||||
```
|
||||
|
||||
Yay, we are now running current stable Ruby!
|
||||
You're now running the current stable version of Ruby!
|
||||
|
||||
### With rbenv {#rbenv}
|
||||
|
||||
@@ -63,8 +64,8 @@ rbenv init
|
||||
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
|
||||
```
|
||||
|
||||
Restart your terminal for changes to take effect.
|
||||
Now you can install the Ruby version of our choice, let's go with current latest stable Ruby:
|
||||
Restart your terminal to apply your changes.
|
||||
Next, you can install the Ruby version you want. Let's install the latest stable version:
|
||||
|
||||
```sh
|
||||
rbenv install {{ site.data.ruby.current_version }}
|
||||
@@ -73,50 +74,50 @@ ruby -v
|
||||
{{ site.data.ruby.current_version_output }}
|
||||
```
|
||||
|
||||
That's it! Head over [rbenv command references](https://github.com/rbenv/rbenv#command-reference) to learn how to use different versions of Ruby in your projects.
|
||||
That's it! Head over to [rbenv command references](https://github.com/rbenv/rbenv#command-reference) to learn how to use different versions of Ruby in your projects.
|
||||
|
||||
## Install Jekyll
|
||||
|
||||
Now all that is left is installing [Bundler]({{ '/docs/ruby-101/#bundler' | relative_url }}) and Jekyll.
|
||||
After installing Ruby, install Jekyll and Bundler.
|
||||
|
||||
### Local Install
|
||||
|
||||
Install the bundler and jekyll gems:
|
||||
|
||||
```sh
|
||||
gem install --user-install bundler jekyll
|
||||
```
|
||||
|
||||
and then get your Ruby version using
|
||||
Get your Ruby version:
|
||||
|
||||
```sh
|
||||
ruby -v
|
||||
{{ site.data.ruby.current_version_output }}
|
||||
```
|
||||
|
||||
Then append your path file with the following, replacing the `X.X` with the first two digits of your Ruby version.
|
||||
Append your path file with the following, replacing the `X.X` with the first two digits of your Ruby version:
|
||||
|
||||
```bash
|
||||
echo 'export PATH="$HOME/.gem/ruby/X.X.0/bin:$PATH"' >> ~/.bash_profile
|
||||
```
|
||||
|
||||
To check that your gem paths point to your home directory run:
|
||||
Check that `GEM PATHS:` points to your home directory:
|
||||
|
||||
```sh
|
||||
gem env
|
||||
```
|
||||
|
||||
And check that `GEM PATHS:` points to a path in your home directory.
|
||||
|
||||
{: .note .info}
|
||||
Every time you update Ruby to a version with a different first two digits, you will need to update your path to match.
|
||||
Every time you update Ruby to a version in which the first two digits change, update your path to match.
|
||||
|
||||
### Global Install
|
||||
|
||||
{: .note .warning}
|
||||
We strongly recommend against installing Ruby gems globally to avoid file permissions problems and using `sudo`.
|
||||
We recommend not installing Ruby gems globally to avoid file permissions problems and using `sudo`.
|
||||
|
||||
#### On Mojave (10.14)
|
||||
|
||||
Because of SIP Protections in Mojave, you must run:
|
||||
Because of SIP Protections in Mojave, run:
|
||||
|
||||
```sh
|
||||
sudo gem install bundler
|
||||
@@ -125,12 +126,12 @@ sudo gem install -n /usr/local/bin/ jekyll
|
||||
|
||||
#### Before Mojave (<10.14)
|
||||
|
||||
You only have to run:
|
||||
Run:
|
||||
|
||||
```sh
|
||||
sudo gem install bundler jekyll
|
||||
```
|
||||
|
||||
## Problems?
|
||||
## Troubleshooting
|
||||
|
||||
Check out the [troubleshooting]({{ '/docs/troubleshooting/' | relative_url }}) page or [ask for help on our forum](https://talk.jekyllrb.com).
|
||||
See [Troubleshooting]({{ '/docs/troubleshooting/' | relative_url }}) or [ask for help on our forum](https://talk.jekyllrb.com).
|
||||
Reference in New Issue
Block a user