2017-04-22 55 views
1

我是Ruby和Jekyll的新手。最近我試圖在我的GitLab Pages實例上安裝Jekyll Multiple Languages Plugin。我已經設法成功添加 「創業板安裝哲基爾多語言,插件捆綁 安裝」jekyll-multiple-languages-plugin無法找到

.gitlab-ci.yml但是當我嘗試添加

gems:

  • jekyll-multiple-languages-plugin

成_config.yml爲了使用它的網站上我的提交失敗,出現以下錯誤:

Using jekyll-watch 1.5.0

Using jekyll 3.4.3

Bundle complete! 3 Gemfile dependencies, 20 gems now installed.

Bundled gems are installed into /usr/local/bundle.

$ jekyll build -d public

Configuration file: /builds/myusername/forty-jekyll-theme/_config.yml

Dependency Error: Yikes! It looks like you don't have jekyll-multiple-languages-plugin or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- jekyll-multiple-languages-plugin' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/ ! jekyll 3.4.3 | Error: jekyll-multiple-languages-plugin

ERROR: Job failed: exit code 1

我已經使用這個方法,因爲任何試圖編輯Gemfile中結束了在犯的錯誤。我也嘗試過除了加入軟件包安裝之外的所有步驟。在這種情況下,我得到了同樣的錯誤,但最開始的樣子:

18 gems installed

$ gem install jekyll-multiple-languages-plugin

Successfully installed jekyll-multiple-languages-plugin-1.5.1

1 gem installed

$ jekyll build -d public

我沒能找到解決它的堆棧溢出,也沒有其他網站的方式。 For example this did not help

回答

0

在Jekyll的IRC頻道的支持下,我設法解決了這個問題。以下是具體步驟:

  1. 我用的Gemfile。現在看起來

    source 'https://rubygems.org' 
    
    gem 'jekyll' 
    
    group :jekyll_plugins do 
    gem 'jekyll-multiple-languages-plugin' 
    end 
    
  2. 第二修改的事情是.gitlab-ci.yml(第一行 - 圖像:紅寶石 - 也被包括)

    image: ruby 
    
    pages: 
        stage: build 
        script: 
    # - gem install jekyll 
        - gem install bundler 
    # - gem install jekyll-multiple-languages-plugin 
        - bundle install 
        - bundle exec jekyll build -d public 
    # - jekyll build -d public 
        artifacts: 
        paths: 
        - public 
        only: 
        - master 
    

它產生一個錯誤,但這只是由於缺少標準插件配置中的聲明語言而導致的。