Does the installation of Jekyll need GCC on OSX?

浪子不回头ぞ 提交于 2019-12-19 16:51:13

问题


Jekyll Installation says:

GCC and Make (in case your system doesn’t have them installed, which you can check by running gcc -v and make -v in your system’s command line interface)

I am using macOS Sierra. And I have installed Command Line Tools (CLT) for Xcode. And gcc -v produces:

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin 

It means that I have clang installed. Do I still need to install GCC?


回答1:


Usually you set this:

CC=clang



回答2:


It looks like I was wrong ;)

You don't have to install GCC.

It should be enough to:

1. Install Ruby

I prefer to install from sources: https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.1.tar.gz

> ./configure --prefix=$HOME/opt/ruby
> make
> make install

2. Install RubyGems

Again, I prefer to install from sources: https://rubygems.org/pages/download

> export PATH=$HOME/opt/ruby/bin:$PATH
> ruby setup.rb

3. Change repo location

I don't compile Ruby with ssh. In that case, I have to change the ruby gems repo

> gem sources -r https://rubygems.org/
> gem sources -a http://rubygems.org/

(if you want to build with OpenSSL, take a look here: http://www.owsiak.org/?p=3262 There is a sample related to building OpenSSL at macOS)

4. You can install Jekyll

> gem install jekyll
> jekyll --version
jekyll 3.5.2

That's it.




回答3:


A lot of people (who are not using Linux) are having trouble with setting up Jekyll. If you want no problems, you can also use Cloud9 for Jekyll. Cloud9 is an online virtual Linux environment (and IDE).

The steps are:

  1. create a free account on Cloud9
  2. create an empty project (Ubuntu)
  3. type on the Cloud9 terminal: gem install jekyll
  4. create an empty _config.yml file in the project root
  5. create a index.md file in the project root
  6. type on the Cloud9 terminal: jekyll serve –host $IP –port $PORT –baseurl ''
  7. your (very basic) website is now running ‘locally’ on Cloud9 and can be accessed by clicking 'Preview Running Application'

I created an archive with some Jekyll scripts to get going. You can find it on jekyllcodex.org.



来源:https://stackoverflow.com/questions/46019526/does-the-installation-of-jekyll-need-gcc-on-osx

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!