DEV Community

Jess Lee
Jess Lee

Posted on

Getting My Dev Environment Set Up Again: My Day in Dependency Hell

The day before I started General Assembly's Web Development Immersive, our cohort had a mandatory ‘installfest' pizza party. Bright eyed students gathered together and opened up their terminal for the first time.

We were told to type this:

bash <(curl -sL
Enter fullscreen mode Exit fullscreen mode

...and that was it. We weren't given much context for what was happening, but I knew it was magical because progress bars were filling up and illegible text was running through the window. If I wasn't sitting in that classroom, I would have thought my computer was getting hacked, or something scary like that. I asked one of our instructional assistants whether or not we'd be able to 'do this' after we graduated and found out later that I was known in the teacher's lounge as the girl who wanted to write bash scripts.

Over a year later, today, I'm sitting in front of a new machine and have no idea how to set up my dev environment. Git and Ruby have always, just, been there for me. I also haven't coded in a few weeks (there's a surprisingly large amount of non-coding work to do for The Practical Dev) so I'm excited and eager to rackup a server.

What I Set Up

Instead of forking a repo (there are so many good ones - like this!), I'm going to do a (mostly) manual installation and keep track of everything I need here for next time.

  • chrome
  • iTerm2
  • XCode + Git
  • atom (first time trying it! g'bye sublime.)
  • atom shell commands
  • mkdir ~/Code
  • clone repo
  • generate new ssh keys for github
  • create an alias for the directory
  • update terminal prompt to my liking (emojis were involved)
  • homebrew for easy installation of all other things
  • ruby
  • rbenv
  • postgresql

...The Pain Begins

After installing the above, I typed bundle install and crossed my fingers.

An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that gem install json -v 1.8.3 succeeds before bundling.
Enter fullscreen mode Exit fullscreen mode

Of course, gem install json -v '1.8.3' also hit an error. This led to installing libv8 and trying out a whole host of other things. Like adding if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi to my bash profile.

I'm still stuck while typing this -- and really wish I took better notes on how I fiddled around. I think the error is related to how I installed rbenv because the directories/paths are feeling off with my gemfiles. I'm supposed to be running ruby 2.3.0 with the app, but my gems are getting installed here: /usr/local/lib/ruby/gems/2.4.0/

Before noticing this, I was also getting Ruby 2.3.0 when typing in therbenv global command but seeing Ruby 2.4.0 when I typed the ruby -v command. I've since fixed this but the above gem issue is still happening.

Anyway, it's been hours and I need a caffeine boost.



..And I'm back. And yes, it was a rbenv issue. I ended up uninstalling rbenv and removing all .rbenv files. I also did a brew uninstall ruby to be safe. This time, I made sure to brew install rbenv before ruby, and to actually follow the rbenv instructions. I realized on this go around that I didn't run the rbenv init command originally.

bundle install worked almost flawlessly -- just needed to download the rubyracer gem and append -- --with-system-v8 to install the libv8 gem.

Now assign me a ticket.

Top comments (9)

msyvr profile image
Monica Spisar

I'm a relatively new dev and have only set up my environment a few times, so it feels useful to read through your process - if only to have a refresher without the pain of actually doing it. Thanks for taking the time to post this.

On a completely separate topic - Jess & Ben, would you consider adding dates/times to the comments? being pretty new, it may not seem obviously useful right now. But, as the site becomes populated, it'll be useful in some cases, at least, to compare post dates for different yet related contributions.

jess profile image
Jess Lee

Hey @msyvr ! We've added date/time to our backlog. You can follow along on the progress here :)

jess profile image
Jess Lee

@msyvr you can see dates on comments now!

musingmurmurs profile image

I feel your pain. Still feeling it.
Also thought sr devs would help me solve install issue probs. But unless your explanation skills for debugging are good (so rare :( ), you just ish feel this way for your first (3-5!?) yrs of coding.
Still feeling it...

shayde profile image
Shayde Nofziger

One way I've found that has proved helpful in situations like this is to try and create an "environment setup guide" as you go, so you can document your understanding of the setup process and ask for feedback as you get stuck.

This will also help future developers on your team that can now reference your document and update/fix it as they stumble across issues.

My team has even gone so far as to put those guides under source control so there's a history of edits. This way, if someone is confused by a step in the process, they can see who added/last changed it and can approach that person with their question.

musingmurmurs profile image

Documentation + artifacts! Love it and will try.

rubyjedi profile image
Laurence A. Lee

Have you tried RVM -vs- rbenv? It may not get the best press in the blogs, but it's always provided a consistent workspace across multiple versions of Rubies and Gemsets, in my experience.

ben profile image
Ben Halpern

My relationship with RVM is that it works for me and I haven't ever really considered switching, but almost everyone seems to recommend rbenv, so I don't try to pull people away from that because I don't have a strong opinion one way or another.

jess profile image
Jess Lee

I haven't tried RVM but Ben actually uses it so I've mostly heard the good sides!