Giter Site home page Giter Site logo

rails_tutorial_sublime_text's Introduction

Rails Tutorial Sublime Text setup

These are the steps needed to set up Sublime Text 2 as in the Ruby on Rails Tutorial. Instructions are for OS X; Linux and Windows users should make substitutions as necessary. (This may require web searches. Please let me know if you find something that you think should be included here.)

Command-line command

On OS X, you can set up subl as a command-line command like this:

$ ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl

This assumes that there is a ~/bin directory on your executable path. If that isn't the case, follow the instructions on this Stack Overflow thread.

On Linux (especially Ubuntu), the command is similar to OS X; the paths differ and you must use sudo, which is required because ordinary users don't have permission to write to /usr/bin:

$ sudo ln -s ~/Applications/Sublime\ Text\ 2/sublime_text /usr/bin/subl

Alternatively, add an alias to sublime_text in your ~/.bashrc file. This method doesn't require sudo. But it assumes you are using bash. There are similar methods available for other shells. Google is your friend.

Use any editor like gedit or vim to open ~/.bashrc.

$ gedit ~/.bashrc

Add alias subl='~/Applications/Sublime\ Text\ 2/sublime_text' at the end of the file. Save and exit.

(You may have to replace the path to sublime_text with the correct one for your system.)

On Linux Mint, take a look at Install Sublime Text 2 in Linux Mint.

On Windows, you can simply double-click the application icon. The setup at the command line depends on which shell you use; see if one of the techinques at the Stack Overflow discussion on Sublime Text from Command Line (Win7) works for you. You might also want to check out the video Easily Open Files from Windows Command Prompt with Sublime Text 2 (I suggest changing st2 to subl to be consistent with the instructions for the other platforms).

Basic configuration

Open up Sublime Text and use the View menu to modify the following settings:

View > Hide Minimap

View > Side Bar > Hide Side Bar

View > Layout > Columns: 2

Copy auxiliary files

$ cd /tmp
$ git clone https://github.com/mhartl/rails_tutorial_sublime_text.git
$ cp -r rails_tutorial_sublime_text/* \
        ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/User/

Setup on Linux is similar, but with a different target directory for cp:

$ cp -r rails_tutorial_sublime_text/* \
        ~/.config/sublime-text-2/Packages/User/

On Windows, the target directory is as follows:

$ cd /tmp
$ git clone https://github.com/mhartl/rails_tutorial_sublime_text.git
$ cp -r .\rails_tutorial_sublime_text\* \
        '~\AppData\Roaming\Sublime Text 2\Packages\User'

Note: If using Windows Vista, 7, or 8, you should first copy all the folders and files from the remote repo into your local temporary folder located at C:\Users\User\AppData\Local\Temp. Then proceed to move these same files to C:\Users\User\AppData\Roaming\Sublime Text 2\Packages\User.

Install Sass syntax highlighting

Install Package Control and then go to Preferences > Package Control. Select Install Package and then select the Sass package.

Set up the theme

Select Preferences > Color Scheme > User > Railscasts

Install the Rails Tutorial snippets

https://github.com/mhartl/rails_tutorial_snippets

Install Sublime Text Alternative Auto-completion

https://github.com/alexstaubo/sublime_text_alternative_autocompletion

Install SublimeERB

https://github.com/eddorre/SublimeERB

Install RubyTest

Follow https://github.com/maltize/sublime-text-2-ruby-tests, or install RubyTest using Package Control.

Go to Preferences > Package Settings > RubyTest > Settings - User and paste in the following code:

{
  "check_for_rbenv": true,
  "check_for_rvm": true,
  "check_for_bundler": true
}

If you want the "Red" part of "Red-Green-Refactor" to be truly red, edit the file "TestConsole.hidden-tmTheme" in the Library/Application\ Support/Sublime\ Text\ 2/Packages/RubyTest directory:

$ cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/RubyTest
$ subl TestConsole.hidden-tmTheme

In that file, change

<string>#FF1493</string>

to

<string>#FF0000</string>

You may have to restart Sublime Text 2 to activate the change.

If you ever get the error

/bin/sh: rspec: command not found

you can simply quit Sublime Text and then restart it by typing

$ subl

(with no dot).

rails_tutorial_sublime_text's People

Contributors

brettation avatar inlikealion avatar matthewrobertson avatar mhartl avatar michaelrkn avatar nicodeceulaer avatar ryan-noland avatar ujpandey avatar yorah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rails_tutorial_sublime_text's Issues

Ruby Test Colors Fix

Screen Shot 2012-12-28 at 9 23 58 PM

The run_ruby_test.py folder needs to be altered at lines 17 and 34 from "Packages/RubyTest/TestConsole.hidden-tmTheme" to correlate to the Rails Tutorial "Packages/User/CustomTestConsole.tmTheme" in order to get the colors working in RubyTest.

Seeing strange characters in console runs

�[32m. is shown highlighted in white before every test run (the dot part). Any ideas on what may be causing this?

Update: This is the color code being output by the spec formatter with the --color option. This was included in my .rspec file and when commented out, the package now works.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.