Setup recipe for Rails Girls
Cooking time: 5min active / 15-30min passive
To build apps and other things with Ruby on Rails, we need to setup some software and the developer environment for your computer.
Follow the instructions for your operating system. If you run into any problems, don’t panic. Inform us at the event and we can solve it together.
- Setup for OS X
- Setup for Windows
- Setup for Linux
- Alternative Installment for all OS
- Using a Cloud Service - No Installation Required
Setup for OS X
1. Let’s check the version of the operating system.
Click the Apple menu and choose About this Mac.
2. In the window you will find the version of your operating system.
If your version number starts with 10.6, 10.7, 10.8, 10.9 or 10.10 this guide is for you. If it’s something else, we can setup your machine at the event.
3a. If your OS X version is 10.9 or higher:
If your version number starts with 10.9 or 10.10, follow these steps. We are installing homebrew and rbenv.
3a1. Install Command line tools on terminal:
xcode-select --install
3a2. Install Homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
3a3. Install rbenv:
brew update
brew install rbenv rbenv-gem-rehash ruby-build
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
echo 'export PATH="$HOME/.rbenv/shims:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
3a4. Build Ruby with rbenv:
You can find the newest version of Ruby with the command “rbenv install -l”.
rbenv install 2.2.0
If you got “OpenSSL::SSL::SSLError: … : certificate verify failed” error, try it this way.
brew install curl-ca-bundle
cp /usr/local/opt/curl-ca-bundle/share/ca-bundle.crt `ruby -ropenssl -e 'puts OpenSSL::X509::DEFAULT_CERT_FILE'`
3a5. Set default Ruby:
rbenv global 2.2.0
3a6. Install rails:
gem i rails --no-ri --no-rdoc
3b. If your OS X version is 10.6, 10.7, or 10.8:
Download the RailsInstaller for your version of OS X:
- RailsInstaller for 10.7 and 10.8 (325MB)
- RailsInstaller for 10.6 (224MB)
Double click the downloaded file and it will unpack it into the current directory. Double click the the newly unpacked ‘RailsInstaller-1.0.4-osx-10.7.app’ or ‘RailsInstaller-1.0.4-osx-10.6.app’ and follow the instructions. It will open a README file with ‘Rails Installer OS X’ at the top. Please ignore the instructions in this file.
If the Rails version wasn’t the latest, you could update it using a following command on terminal.
gem update rails --no-ri --no-rdoc
Make sure that all works well by running the application generator command.
rails new railsgirls
4. Install a text editor to edit code files
For the workshop we recommend the text editor Atom.
If you are using Mac OS X 10.7 or older versions, you can use another editor Sublime Text 2.
5. Update your browser
Open whatbrowser.org and update your browser if you don’t have the latest version.
Now you should have a working Ruby on Rails programming setup. Congrats!
Setup for Windows
1. Install Rails
Search for command prompt
in the search bar. Right click on command prompt and choose “Run as administrator”
Click Yes to allow the app to make changes to your PC
Copy the install text from the Chocolatey into the command prompt window.
If you don’t get the right result from command prompt you can try the same thing in powershell.
Close and reopen the command prompt as above. Then type:
choco install cmder
Note: If you see an error when installing cmder, you might need to install Visual C++ Redistributable.
Open Cmder
It will be in C:\\tools\cmder
if you can’t find it through the search function
run the following command:
choco install git
choco install atom
choco install sqlite
choco install ruby
choco install ruby2.devkit
choco install nodejs
gem install rails --no-document
Make sure that all works well by running the application generator command.
rails new railsgirls
cd railsgirls
rails server
2. Update your browser
If you use Internet Explorer, we recommend installing Firefox or Google Chrome.
Open whatbrowser.org and update your browser if you don’t have the latest version.
Setup for Linux
1. Install Rails
To install the Ruby on Rails development environment you just need to copy the line below for your Linux distribution (Ubuntu or Fedora), paste it in the Terminal and press Enter. Enjoy the text flying on the screen; it will take quite some time. Grabbing a refreshing drink before starting is encouraged.
For Ubuntu:
bash < <(curl -sL https://raw.github.com/railsgirls/installation-scripts/master/rails-install-ubuntu.sh)
If you are going to use RVM installations with gnome-terminal, you’ll probably need to change it’s default options before you can see and use the right Ruby and Rails versions. Find out how: RVM documentation.
For Fedora:
bash < <(curl -sL https://raw.github.com/railsgirls/installation-scripts/master/rails-install-fedora.sh)
Make sure that all works well by running the application generator command.
Make sure that all works well by running the application generator command.
rails new railsgirls
cd railsgirls
rails server
2. Install a text editor to edit code files
For the workshop we recommend the text editor Sublime Text.
3. Update your browser
Open whatbrowser.org and update your browser if you don’t have the latest version.
Now you should have a working Ruby on Rails programming setup. Congrats!
Virtual Machine
Instead of installing all tools on your machine, you can also set up a development environment in a Virtual Machine. Please find all the details here.
Using a Cloud Service
Instead of installing Ruby on Rails and an editor on your computer, you can use a webservice for development. All you need is a browser and an internet connection. This guide explains how to get started with nitrous.io. If you’re using a different service, they may use a different wording - e.g. ‘workspace’ instead of ‘box’, but the process is usually pretty similar.
Organizer: Nitrous is a paid service, but free for community usage purpose. Please contact Nitrous <pro [at] nitrous.io> to request a community account with the following list/information.
- Email address of the people you need workspaces for (= email list of members)
- How long they would need to use Nitrous
- Starting from date/time
- How long (days, weeks etc.) you need access
1. Update your browser
If you use Internet Explorer, we recommend installing Firefox or Google Chrome.
Open whatbrowser.org and update your browser if you don’t have the latest version.
2. Create an account
Go to https://nitrous.io and signup.
3. Setup a development box / workspace for ruby on rails
- Login to your nitrous account
- Go to the dashboard by using the green ‘Open dashboard’ button
- Create a nitrous box: pick Ruby/Rails from the templates - everything else can stay as is, but you can change the name of your box if you want to
- It takes a moment until your box is ready
4. Find and restart your development box
- If you’ve just created your box, you can probably skip these steps - they’re good to know if you login to nitrous again later
- You can always find your nitrous boxes by going to the dashboard or choosing ‘Boxes’ from the top menu
- Pick your box from the list of boxes
- If you haven’t used a box in a while, it might have been shutdown due to inactivity. If you are informed that your box is not running, restart it using the respective button
- When your box is up and running, choose ‘IDE’ in order to start coding
5. Coding with your development box
- On the left hand side, you find a file browser where you can navigate your directories and file
- In the middle, you find the editor where you can modify your files
- At the bottom, you find the terminal where you can run commands
- Everything you need is here in you browser window - you do not need to start an editor or terminal anywhere else
- If your following a guide or tutorial, use the commands for Linux even if you are on a Windows computer - your operating system does not matter, since all commands are run on your development box, which is a Linux machine
- If a guide or tutorial asks you to point your browser to something like http://localhost:3000, go to the ‘Preview’ menu and pick ‘Port 3000’
- If, for example, you’re asked to open http://localhost:3000/posts, please append ‘/posts’ manually to the URL that has been opened