Skip to content
Aina Pinto edited this page Jan 19, 2016 · 63 revisions

FAQs - Module 1

OSX and Linux

Windows

Multiplatform Web IDE

How to use Git

OSX and Linux


Q: How to write, save and quit using vi editor?

(PLEASE NOTE: Using vi editor is by no means a necessity and if you have a favorite editor of your own - feel free to use it. If you still would like to use vi...)

A: Here are a few basic commands:

Create/edit a file:

vi <filename>

If the filename exists, you will be editing the existing file; if not, it will create a new file

Moving arround: Vi works in two modes: command mode and insert mode. Command mode allows you to move arround.

To enter text, type the command i (for insert) and you will be able to type text.

To exit insert mode, press esc key

To save a file:

In command mode, type :w press enter

This will save the edits to the file but will not close vi

Quit vi:

In command mode, type :q

You will be prompt with a message asking if you want to save the file before quitting. Select Y/N

Aditional references:

Vi Cheat Sheet How to use vi Editor


Q: How to install PhantomJS on OSX El Capitan?

A: Install using NPM (Node Package Manager)

npm install phantom phantomjs -g

If you do not have NodeJS: brew install node

If you do not have NPM: brew install npm

For more information about this issue and other solutions: https://github.com/Homebrew/homebrew/issues/44535


Q: Problems installing rbenv/updating Rails/getting Git to work (Mac)

A: If you do not have Xcode, you need to install it:

xcode-select --install

If you have Xcode and gets an error about the license, you need to accept the terms:

sudo xcodebuild -license

Q: Why do I keep getting a message that 'rspec' command is not found?

A: If you are using rbenv, you need to run rbenv rehash every time you install a new version of Ruby or a gem that will provide commands, like rspec.


Q: How to install PhantomJS? (Linux)

A: If the error is when adding PhantomJS to path, please check which version you downloaded.

If it was 64 bit:

export PHANTOM_JS="phantomjs-1.9.8-linux-x86_64" 

If it was 32 bit:

export PHANTOM_JS="phantomjs-1.9.8-linux-i686"

If curl throws an error about the SSL certificate:

curl -kL https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2 |tar xvjf

Or else, you can try the instructions here: https://gist.github.com/julionc/7476620


Windows


Q: What to do when Rails fails to update?

A: If you encountered an error when you ran the command gem install rails -v 4.2.3, you will need to download the SSL certificate.

Instructions here: Workaround RubyGems' SSL errors on Ruby for Windows

Another workaround is to run the following commands:

gem source -r https://rubygems.org/
gem source -a http://rubygems.org/
gem update --system

gem install rails -v 4.2.3

Q: How to solve "No source of timezone data could be found" error?

A: Add the following line to your Gemfile

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Then, run the command bundle to install the gem and restart Rails server

More information about this issue: https://github.com/tzinfo/tzinfo/wiki/Resolving-TZInfo::DataSourceNotFound-Errors


Q: How to add PhantomJS to PATH?

A: After downloading PhantomJS, extract the files to a directory that you will remember. Make sure that you choose a directory that has no space on its name.

  • Open phantomjs-2.0.0-windows directory and navigate to bin, inside which you will find phantomjs.exe.
  • Right click on the address bar and copy the address as text. If you extracted the files to C, for instance, the address will be C:\phantomjs-2.0.0-windows\bin
  • Click the Windows key and type "env". Select "Edit the system environment variables"
  • Click 'Environment Variables'
  • On "User variables for <your-username>, select "path", click "Edit..." and them click "Edit text..."
  • By the end of that line, add a ; (semi-colon) and paste the address of phantomjs
  • Restart your console
  • Type phantomjs -v to see if everything is OK.

Q: How to fix the "ExecJS::ProgramError"?

A: There is an incompatibility between recent versions of the CoffeeScript gem and Windows 64 bit. To fix it, you need to download and install NodeJS: https://nodejs.org/en/download/ After installing, you will need to restart the console.


Q: "DL is deprecated, please use Fiddle"

A: The message above may pop up every time you start the console or when running a Rails command. This is not an error. It is just an alert, so there is no need to be concerned. If you want to get rid of it, there are a few suggestions here: http://stackoverflow.com/questions/15590450/ruby-2-0-0p0-irb-warning-dl-is-deprecated-please-use-fiddle/15601984#15601984


Clone this wiki locally