7

I use Jekyll on my Ubuntu laptop. It worked with 15.10. I've upgraded to 16.04 and I got this error message :

$ jekyll -v
bash: /usr/local/bin/jekyll : /usr/bin/ruby2.1 : bad interpreter: no file or folder

Here is the installed version of Ruby :

$ ruby -v
ruby 2.3.0p0 (2015-12-25) [i386-linux-gnu]

I've tried:

$ gem update jekyll
Updating installed gems
Nothing to update

As which ruby returns /usr/bin/ruby, I've updated /usr/local/bin/jekyll changing #!/usr/bin/ruby2.1 to #!/usr/bin/ruby.

Now I get :

$ jekyll -v
/usr/lib/ruby/2.3.0/rubygems/dependency.rb:319:in 'to_specs': Could not find 'jekyll' (>= 0) among 11 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/home/samuel/.gem/ruby/2.3.0:/var/lib/gems/2.3.0:/usr/lib/i386-linux-gnu/rubygems-integration/2.3.0:/usr/share/rubygems-integration/2.3.0:/usr/share/rubygems-integration/all', execute 'gem env` for more information
    from /usr/lib/ruby/2.3.0/rubygems/dependency.rb:328:in 'to_spec'
    from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_gem.rb:65:in 'gem'
    from /usr/local/bin/jekyll:22:in 'main'

Here is what gem env returns :

$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.5.1
  - RUBY VERSION: 2.3.0 (2015-12-25 patchlevel 0) [i386-linux-gnu]
  - INSTALLATION DIRECTORY: /var/lib/gems/2.3.0
  - USER INSTALLATION DIRECTORY: /home/samuel/.gem/ruby/2.3.0
  - RUBY EXECUTABLE: /usr/bin/ruby2.3
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - SPEC CACHE DIRECTORY: /home/samuel/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /var/lib/gems/2.3.0
     - /home/samuel/.gem/ruby/2.3.0
     - /usr/lib/i386-linux-gnu/rubygems-integration/2.3.0
     - /usr/share/rubygems-integration/2.3.0
     - /usr/share/rubygems-integration/all
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /sbin
     - /bin
     - /usr/games
     - /usr/local/games
     - /snap/bin
  • What does which ruby say? – edwinksl Jun 10 '16 at 8:09
  • @edwinksl /usr/bin/ruby – Samuel Jun 10 '16 at 8:10
  • How about cat /usr/local/bin/jekyll? – edwinksl Jun 10 '16 at 8:17
  • @edwinksl this : pastebin.com/tBriZuSX – Samuel Jun 10 '16 at 8:20
  • Try changing the shebang line to #!/usr/bin/ruby. You will need sudo privileges to do this. – edwinksl Jun 10 '16 at 8:21
6

I had the same issue. It's caused by ruby update in new Ubuntu. Just uninstall jekyll and install it again:

gem uninstall jekyll
gem install jekyll
| improve this answer | |
0

In addition to the answer by @Piotr, I also had to uninstall and reinstall the gem bundler. That is, I ran,

gem uninstall bundler
gem install bundler
bundle

Only after this did bundle exec jekyll serve start to work again after my upgrade from ubuntu 18.04 to 20.04.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.