0

I'm trying to get up and running with ruby and the jekyll gem on my fresh instance of Ubuntu 16.04.

    usernamehere@usernamehere-hp:~/workspace/username.github.io$ ls -la /usr/local/bin/bundler
    -rwxr-xr-x 1 root root 498 Apr 18 18:18 /usr/local/bin/bundler
    usernamehere@usernamehere-hp:~/workspace/username.github.io$ ls -la /usr/local/bin/bundle
    -rwxr-xr-x 1 root root 497 Apr 18 18:18 /usr/local/bin/bundle
    usernamehere@usernamehere-hp:~/workspace/username.github.io$ ls -la /usr/bin/bundle
    -rwxr-xr-x 1 root root 590 Mar 13  2016 /usr/bin/bundle
    usernamehere@usernamehere-hp:~/workspace/username.github.io$ ls -la /usr/bin/bundler
    -rwxr-xr-x 1 root root 590 Mar 13  2016 /usr/bin/bundler

But I seem to have 2 or 4 copies of the ruby gem bundler installed. This is giving me conflicting things when I do things like:

bundle update vs sudo bundle update and bundle exec jekyll serve vs. sudo bundle exec jekyll serve

I'm also getting conflicting responses when I run bundle update vs bundler update vs sudo bundle update vs sudo bundler update.

What the heck is going on? I don't mind keeping only the ones in /usr/bin but I don't know if I should be using bundle or bundler or how to unsintall the entries in /usr/local/bin.

Any ideas?

fIwJlxSzApHEZIl
  • 1,166
  • 2
  • 10
  • 21

1 Answers1

1

I think you used sudo apt install ruby to get ruby in your system. Which unfortunately is outdated and not the best way to use ruby.

Try completely purging your current ruby and re-installing it using either rvm or rbenv

You'll find a step by step guide here.

PS: You should never run bundler as ROOT, Completely removing all gems from system.

Sirajus Salekin
  • 1,677
  • 12
  • 28
  • My intention was to use the pre-existing ruby installation, if there is one, that comes with ubuntu. I wasn't keen on working with `rvm` or `rbenv` just to use jekyll since personally I'm not a fan of ruby and don't want to overcomplicate things just to write blog posts but it looks like I might not have a better option. – fIwJlxSzApHEZIl Apr 19 '17 at 16:12
  • I see. Did you follow [these procedures](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-jekyll-development-site-on-ubuntu-16-04) ? – Sirajus Salekin Apr 20 '17 at 09:29
  • I didn't unfortunately I just ran `bundle exec jekyll serve` until I stopped getting error messages. I've gotten rather comfortable with the package manager so I was confident that I would get it right. I was unfortunately not aware that there is a `bundler` and a `bundle` and I wasn't ready for the package manager to install things to `/usr/local/bin` when they already existed in `usr/bin`. Maybe that's my fault thought. – fIwJlxSzApHEZIl Apr 20 '17 at 16:18
  • How would I purge all instances of ruby / bundle / bundler from my system? `sudo apt-get purge ruby bundle bundler` ? – fIwJlxSzApHEZIl Apr 20 '17 at 16:19
  • 1
    Bundler is a gem, you can uninstall it by running `gem uninstall bundler && sudo gem uninstall bundler`, to remove all installed gems run `gem uninstall --all && sudo gem uninstall --all` to purge ruby run `sudo apt purge ruby`. – Sirajus Salekin Apr 21 '17 at 03:02
  • 1
    If you're doing a clean install of jekyl, i would suggest to follow the [digital ocean's guide](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-jekyll-development-site-on-ubuntu-16-04), it's the most hassle free (no rvm, rbenv) way. – Sirajus Salekin Apr 21 '17 at 03:05
  • thank you I will definitely give that a try this weekend Sirajus – fIwJlxSzApHEZIl Apr 21 '17 at 20:34