38

I want to install a ruby gem globally (sudo gem install capybara-webkit) but I want it to be installed from the master in its github repository. I know this can be done using bundler but I want to do it from the command line because I'm coding mainly using pry.

1 Answer 1

73
  1. Download the source:

    git clone https://github.com/thoughtbot/capybara-webkit.git
    
  2. Build the gem:

    cd capybara-webkit && gem build capybara-webkit.gemspec
    
  3. Install it (the filename/version may vary):

    sudo gem install capybara-webkit-0.14.1.gem
    
Sign up to request clarification or add additional context in comments.

2 Comments

I would leave the sudo off of step 3, (stackoverflow.com/questions/2119064/…) but otherwise, great answer! The one other thing to note is that the .gemspec file isn't always exactly the same as the name of the gem or the directory it's in, so just double check the filename before step 2.
I'm not sure of the effect of sudo by on Cygwin I used gem install --no-user-install, otherwise it installs into ~/.gem/ruby/$VER. --no-user-install is a saver.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.