When you use Webmock or VCR or both together along with Cucumber, you will face an issue with your tests not being able to record as webmock and vcr blocks all outbound HTTP requests.
You will see error somewhat like this:
The request that is triggering the error looks like it’s coming from Capybara. When you use one of the javascript drivers, capybara boots your app using a simple rack server, and then polls the special__identify__
path so it knows when it has finished booting.
After running brew tap -repair, rvm was able to auto install the missing dependencies via homebrew and install my ruby without problems. No need to manually install each package or anything else. RVM and rbenv solve basically the same core problem, but do it in different ways. RVM gives you a lot of sugar and tools to smooth the process out for you, whereas rbenv is a lot more minimal and you'll have to do more work that RVM might have otherwise done for you. Over time, the tools got better, and ever since Mavericks, setting up a development environment on a Mac with Apple's standalone Command Line Tools, Homebrew, Git, a Ruby manager (such as chruby, rbenv, or RVM), Ruby, and Rails has been a fairly stress-free process that's.
Development, Homebrew, MacOSX, Ruby 2.0.0, RVM Moving between jobs and setting up new machine can be quite painful at times, I recently moved into new assignment and faced the challenge so to avoid pain for other just summarising the steps I followed for smooth Installation. Homebrew complements macOS (or your Linux system). Install your RubyGems with gem and their dependencies with brew. “To install, drag this icon” no more. Homebrew Cask installs macOS apps, fonts and plugins and other non-open source software.
There are few ways to tackle this problem based on your situation
1. If you are only using only Webmock
If you don’t need it, remove it from the Gemfile. If you do need it, then you may need to configure it more precisely to your needs, one thing worked for me is adding this snippet to my env.rb
By doing so, you allow real web access to your localhost.
2. If you are using vcr & webmock both
If you’re using VCR, you don’t need to configure webmock with the require 'webmock/cucumber'
line and the WebMock.allow_net_connect!
line. VCR takes care of any necessary WebMock configuration for you.
Rum Brewing Recipe
VCR includes support for ignoring localhost requests so that it won’t interfere with this. The relish docs, but in short you can use this snippet in VCR configuration to get it working.
Create vcr.rb inside feature/support folder and add this:
If this doesn’t work then follow the detailed documentation at Relish to get it working with cucumber
The MBP is my development machine, so I needed all of my tools installed with the ability to update them with ease. In the past, I used MacPorts to take care of my MySQL, Memcached, and Ruby installions and it worked just fine. This time around however, I wanted something new and fun. Homebrew.
Homebrew is a new package manager for OS X. Unlike Fink or MacPorts, Homebrew integrates with the core operating system, reducing the number of extra libraries to install etc. Another neat feature is the ability to write software package recipes in Ruby, awesome.
Here are some raw installation instructions (clean system). I like to keep everything under user ownership to make life more enjoyable, say no to sudo.
You will need the latest version of xcode, you can get it here. After the installation is complete, you may continue.
My homebrew experience has been a happy one, I don’t see myself using MacPorts or Fink again.
Homebrew documentation can be found here.
RVM (Ruby Version Manager) takes care of managing my multiple Ruby and Gem versions. Leaving the OS X default installation of ruby alone, RVM installs to a users home directory, changing the required system variables. Just how Homebrew is under user ownership, RVM is quite happy running this way as well and so am I.
To install RVM, do the following.
Rvm Install Brew Update
Add the following line to the end of your .profile or .bash_profile or .bashrc file.
Rvm Osx_brew
Pretty neat eh? (I’m Canadian, it’s ok) RVM documentation can be found here.