LanceLafontaine
LanceLafontaine

Reputation: 6030

Gem does not install Jekyll on Ubuntu 14.04: command not recognized

I have spent a few hours trying to get ruby and jekyll installed on my fresh install of Ubuntu 14.04. I've installed all the dependencies and whatnot:

[05:25 PM] [~] $ ruby -v
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]
[05:28 PM] [~] $ rvm -v
rvm 1.26.3 (latest) by Wayne E. Seguin <[email protected]>, Michal Papis             <[email protected]> [https://rvm.io/]
[05:28 PM] [~] $ rbenv -v
rbenv 0.4.0
[05:28 PM] [~] $ nodejs -v
v0.10.25

I have tried installing Jekyll via sudo apt-get install jekyll and sudo gem install jekyll. Both seem to have been installed without trouble. However, checking the version on jekyll gives me:

    [05:31 PM] [~] $ jekyll -v
   /usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find jekyll (>= 0)    amongst [bigdecimal-1.2.5, bigdecimal-1.1.0, bundler-1.7.6, bundler-unload-1.0.2, executable-   hooks-1.3.2, gem-wrappers-1.2.7, io-console-0.4.2, io-console-0.3, json-1.8.1, json-1.5.5,    minitest-5.4.3, minitest-2.5.1, rake-10.3.2, rake-0.9.2.2, rdoc-4.1.2, rdoc-3.9.5, rubygems-   bundler-1.4.4, rubygems-update-2.4.4, rvm-1.11.3.9] (Gem::LoadError)
    from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
    from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
    from /usr/local/bin/jekyll:22:in `<main>'

It seems like I'm getting an error with gem. When I run gem list, I get:

[05:31 PM] [~] $ gem list

*** LOCAL GEMS ***

bigdecimal (1.2.5, 1.1.0)
bundler (1.7.6)
bundler-unload (1.0.2)
executable-hooks (1.3.2)
gem-wrappers (1.2.7)
io-console (0.4.2, 0.3)
json (1.8.1, 1.5.5)
minitest (5.4.3, 2.5.1)
rake (10.3.2, 0.9.2.2)
rdoc (4.1.2, 3.9.5)
rubygems-bundler (1.4.4)
rubygems-update (2.4.4)
rvm (1.11.3.9)

Jekyll is not even in the list. I've tried just about everything I can find online, and I'm at my wits end.

How can I get the Jekyll command to be recognized?

Upvotes: 2

Views: 1684

Answers (1)

Antonio Cangiano
Antonio Cangiano

Reputation: 733

We have two apparently contradictory pieces of information. On one hand jekyll is installed since the command jekyll -v is recognized. On the other hand, both the error you get and the gem list output tell us that your particular version of Ruby doesn't have jekyll installed.

You have a couple of issues to contend with:

  1. OS vs Gem
  2. Ruby version

Here is how you can try to solve it:

  1. Uninstall the apt-get version of jekyll.
  2. Run jekyll -v to verify that you get a command not found error. If it's still a recognized command, run a which jekyll and sudo find / -name jekyll to figure out what's being executed.
  3. With jekyll gone for good, run ruby -v and take note of the version you are using.
  4. Install jekyll with gem install jekyll (add sudo if necessary).
  5. If you've closed your shell or switched to a different directory, run ruby -v again to make sure you are using the same version as before.
  6. Run gem list and this time it should be there.
  7. Run jekyll -v again and it should work.

Upvotes: 4

Related Questions