FHIR Chat · Jekyll on OSX · IG creation

Stream: IG creation

Topic: Jekyll on OSX


view this post on Zulip Grahame Grieve (Oct 07 2019 at 02:47):

I am trying to install Jekyll on OSX. I had thought it was easier than for windows, but apparently not. Ruby simply won't upgrade to 2.6. It keeps spontaineously reverting to 2.3. So presumably something is missing from the jekyll instructions?

view this post on Zulip Eric Haas (Oct 07 2019 at 02:49):

I have had no problems installing Jekyll on my system..

view this post on Zulip Eric Haas (Oct 07 2019 at 02:50):

I will need to what version I am running ...

view this post on Zulip Eric Haas (Oct 07 2019 at 02:51):

(venv37) Erics-Air-2:MyNotebooks ehaas$  ruby --version
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin16]

view this post on Zulip Grahame Grieve (Oct 07 2019 at 02:51):

well, this is me:

$ ruby -v
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]

$ brew install ruby
Warning: ruby 2.6.5 is already installed and up-to-date

$ ruby -v
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]

view this post on Zulip Eric Haas (Oct 07 2019 at 02:51):

so I'll give it a go to 2.6 ...

view this post on Zulip Rob Hausam (Oct 07 2019 at 02:52):

I didn't have any particular trouble with it when I did it originally (but that was quite a while ago). I also helped Melva do it a while back.

view this post on Zulip Grahame Grieve (Oct 07 2019 at 02:53):

it just seems to me that something is missing from the instrutions - you have 2.6.3 installed which is what the system runs.

view this post on Zulip Rob Hausam (Oct 07 2019 at 02:53):

I'm currently on ruby 2.6.3p62.

view this post on Zulip Grahame Grieve (Oct 07 2019 at 02:53):

then you install the latest

view this post on Zulip Grahame Grieve (Oct 07 2019 at 02:53):

but you don't do anything to tell the system to use it, so it ignores it

view this post on Zulip Grahame Grieve (Oct 07 2019 at 02:53):

Jekyll requires 2.6.4+

view this post on Zulip Rob Hausam (Oct 07 2019 at 02:54):

jekyll is working for me on ruby 2.6.3p62

view this post on Zulip Rob Hausam (Oct 07 2019 at 02:54):

I have jekyll 3.8.5

view this post on Zulip Rob Hausam (Oct 07 2019 at 02:57):

(deleted)

view this post on Zulip Eric Haas (Oct 07 2019 at 03:06):

running brew upgrade ruby now...

view this post on Zulip Rob Hausam (Oct 07 2019 at 03:06):

the Jekyll site says Jekyll 4.x requires Ruby version > 2.4.0, and Jekyll >3.2 requires Ruby > 2.1

view this post on Zulip Grahame Grieve (Oct 07 2019 at 03:08):

I don't know how to install older versions of jekyll

view this post on Zulip Eric Haas (Oct 07 2019 at 03:10):

here is what happened to me ....

Erics-Air-2:~ ehaas$ ruby --version
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]

view this post on Zulip Eric Haas (Oct 07 2019 at 03:10):

same as gg

view this post on Zulip Eric Haas (Oct 07 2019 at 03:11):

here is the output of the upgrade:

Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/bundle
Target /usr/local/bin/bundle
already exists. You may want to remove it:
  rm '/usr/local/bin/bundle'

To force the link and overwrite all conflicting files:
  brew link --overwrite ruby

To list all files that would be deleted:
  brew link --overwrite --dry-run ruby

Possible conflicting files are:
/usr/local/bin/bundle
/usr/local/bin/bundler
==> Caveats
By default, binaries installed by gem will be placed into:
  /usr/local/lib/ruby/gems/2.6.0/bin

You may want to add this to your PATH.

ruby is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have ruby first in your PATH run:
  echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile

For compilers to find ruby you may need to set:
  export LDFLAGS="-L/usr/local/opt/ruby/lib"
  export CPPFLAGS="-I/usr/local/opt/ruby/include"

For pkg-config to find ruby you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/ruby/lib/pkgconfig"

view this post on Zulip Rob Hausam (Oct 07 2019 at 03:13):

what do you get with 'which ruby'?

view this post on Zulip Eric Haas (Oct 07 2019 at 03:13):

Erics-Air-2:~ ehaas$ which ruby
/usr/bin/ruby

view this post on Zulip Grahame Grieve (Oct 07 2019 at 03:14):

this is all crazy confusing. I get the same

view this post on Zulip Rob Hausam (Oct 07 2019 at 03:14):

ah - mine is /usr/local/opt/ruby/bin/ruby, which I believe is the brew version

view this post on Zulip Rob Hausam (Oct 07 2019 at 03:14):

I think you need to do what it says in the output above:

If you need to have ruby first in your PATH run:
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile

view this post on Zulip Rob Hausam (Oct 07 2019 at 03:16):

as it says, you may want to force the link: brew link --overwrite ruby

view this post on Zulip Eric Haas (Oct 07 2019 at 03:17):

If you need to have this software first in your PATH instead consider running:
  echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
Erics-Air-2:~ ehaas$   echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
Erics-Air-2:~ ehaas$ ruby --version
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
Erics-Air-2:~ ehaas$ which ruby
/usr/bin/ruby
Erics-Air-2:~ ehaas$

view this post on Zulip Eric Haas (Oct 07 2019 at 03:17):

did not seem to work

view this post on Zulip Rob Hausam (Oct 07 2019 at 03:18):

there's an issue with the version that osx has already installed - possibly the path override is all that you need at this point (I don't recall for sure now if I did the force link or not - but I'm thinking probably not)

view this post on Zulip Eric Haas (Oct 07 2019 at 03:18):

it did after restarting the terminal

Last login: Sat Oct  5 15:14:53 on ttys001
Erics-Air-2:~ ehaas$ whihc ruby
-bash: whihc: command not found
Erics-Air-2:~ ehaas$ which ruby
/usr/local/opt/ruby/bin/ruby
Erics-Air-2:~ ehaas$ ruby --version
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin18]
Erics-Air-2:~ ehaas$

view this post on Zulip Rob Hausam (Oct 07 2019 at 03:18):

yep

view this post on Zulip Rob Hausam (Oct 07 2019 at 03:18):

that should work

view this post on Zulip Eric Haas (Oct 07 2019 at 03:19):

lets see if Jekyll works too...

view this post on Zulip Grahame Grieve (Oct 07 2019 at 03:19):

wow that's obscure

view this post on Zulip Eric Haas (Oct 07 2019 at 03:23):

just as I suspected from last time I did this...

Submitting Usage Stats failed: Operation timed out (Connection timed out)        (02:33.0100)
Jekyll: /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems.rb:284:in `find_spec_for_exe': can't find gem jekyll (>= 0.a) with executable jekyll (Gem::GemNotFoundException) (02:33.0896)
Jekyll: from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/rubygems.rb:303:in `activate_bin_path' (02:33.0896)
Jekyll: from /usr/local/bin/jekyll:23:in `<main>'                                (02:33.0896)
Jekyll has failed. Complete output from running Jekyll:     from /usr/local/bin/jekyll:23:in `<main>'
/2.6.0/rubygems.rb:303:in `activate_bin_path'
 find gem jekyll (>= 0.a) with executable jekyll (Gem::GemNotFoundException)
 (02:33.0902)
Note: Check that Jekyll is installed correctly                                   (02:33.0902)
Publishing Content Failed: Process exited with an error: 1 (Exit value: 1)       (02:33.0904)

Need to update Jekyll too...

view this post on Zulip Rob Hausam (Oct 07 2019 at 03:37):

what jekyll version do you have?

view this post on Zulip Eric Haas (Oct 07 2019 at 03:42):

Just needed to update the gems following the Jekyll guidance here: https://jekyllrb.com/docs/installation/macos/

view this post on Zulip Eric Haas (Oct 07 2019 at 03:43):

Erics-Air-2:IG-Template2 ehaas$ Jekyll --version
jekyll 4.0.0

view this post on Zulip Eric Haas (Oct 07 2019 at 03:44):

that was much less painful than the last time I updated ruby and Jekyll - that time took be about 1/2 a day. :-)

view this post on Zulip Grahame Grieve (Oct 07 2019 at 04:10):

well, Jekyll runs from the command line now, but not for the IGPublisher.

view this post on Zulip Grahame Grieve (Oct 07 2019 at 04:11):

I suppose that's because it doesn't pick up the modified path in the bash script

view this post on Zulip Rob Hausam (Oct 07 2019 at 04:12):

yes - so need to make sure that the path that the publisher (auto build?) is using also has it

view this post on Zulip Grahame Grieve (Oct 07 2019 at 04:15):

running from eclipse...

view this post on Zulip Rob Hausam (Oct 07 2019 at 04:16):

yeah - I'm sure will need to set it there

view this post on Zulip Grahame Grieve (Oct 07 2019 at 04:30):

set it where? Surely OSX has something like a system path where it can be set.

view this post on Zulip Rob Hausam (Oct 07 2019 at 04:33):

yes - it does - although I don't recall the best place to set that at the moment (a search should find the answer)
I think you could also do it in the Eclipse Java runtime environment (would also need to look up where to do that)

view this post on Zulip Grahame Grieve (Oct 07 2019 at 04:42):

https://stackoverflow.com/questions/34022487/add-usr-local-bin-to-path-got-from-system-getenvpath-in-java-run-on-mac-os - looks like the answer involves some demented laughter on other people's parts. Unless - @James Agnew - you're our general java guru who uses osx... am I screwed at this point?

view this post on Zulip Rob Hausam (Oct 07 2019 at 04:45):

yeah - are you sure you can't set the runtime path within Eclipse?
I don't know if I've done that, but it seems like it should be doable

view this post on Zulip Grahame Grieve (Oct 07 2019 at 04:54):

yes i can do that

view this post on Zulip Patrick Werner (Oct 09 2019 at 11:10):

@Grahame Grieve you need to execute echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profileto add the path to the bash profile.

view this post on Zulip Patrick Werner (Oct 09 2019 at 11:11):

This won't work for Apps which aren't started through bash. If you want to set a path for GUI applications as well: https://stackoverflow.com/questions/55648312/mac-os-x-mojave-set-environment-variable-permanently

view this post on Zulip Patrick Werner (Oct 09 2019 at 11:11):

The .plist answer is the right one


Last updated: Apr 12 2022 at 19:14 UTC