Etua
Etua

Reputation: 89

jekyll-multiple-languages-plugin cannot be found

I'm newbie to Ruby and Jekyll. Recently I've tried to install Jekyll Multiple Languages Plugin onto my GitLab Pages instance. I've managed to successfully add 'gem install jekyll-multiple-languages-plugin bundle install'

into the .gitlab-ci.yml but when I try to add

gems:

  • jekyll-multiple-languages-plugin

into _config.yml in order to use it on the site my commit fails with the following error:

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

I have used this method because any attempt to edit Gemfile ends up in commit error. I've also tried to do all presented steps except adding bundle install. In that case I get the same error, but the beginning looks like:

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

I did not manage to find the way to solve it on Stack Overflow nor other sites. For example this did not help

Upvotes: 1

Views: 399

Answers (1)

Etua
Etua

Reputation: 89

With the awesome support of allejo from Jekyll's IRC channel I've managed to solve the problem. Here are the steps:

  1. I've used Gemfile. Now it looks like

    source 'https://rubygems.org'
    
    gem 'jekyll'
    
    group :jekyll_plugins do
     gem 'jekyll-multiple-languages-plugin'
    end
    
  2. The second modified thing was .gitlab-ci.yml (the first line - image: ruby - is also included)

    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
    

It produced a bug, but it was only caused by the lack of declared language which is part of standard plugin configuration.

Upvotes: 0

Related Questions