NVM provides you more convenient way to manage and set up your Javascript(Node.js) environment.
First install NVM, note git
must be installed on your sistem:
^
git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm && git checkout git describe --abbrev=0 --tags
^
To activate nvm, you need to source it from your shell:
^
cd # go to home folder
^
source ~/.nvm/nvm.sh
^
If you want to see what versions of Node.js are available to install:
^
nvm ls-remote
^
To install Node.js v0.11.14 just run:
^
nvm install...
Add in Gemfile:
group :development, :test do
gem 'rspec-rails'
gem 'spork-rails'
end
group :test do
gem 'capybara'
gem 'database_cleaner'
gem 'email_spec'
gem 'poltergeist'
gem 'launchy'
gem 'selenium-webdriver'
end
Run bundle install
Ensure your spec_helper.rb
looks similar with this:
require 'rubygems'
require 'spork'
#uncomment the following line to use spork with the debugger
# require 'spork/ext/ruby-debug'
Spork.prefork do
# Loading more in this block will cause your tests to ...
If some of your scripts don't work with turbolinks, you should do the following:
ready = ->
#your code here
$(document).ready(ready)
$(document).on('page:load', ready)