Rubocop and Flycheck :
Flycheckis a emacs mode which helps us with IDE like warnings in Emacs. I am already using
enh-ruby-modewhich helps with some of the syntax errors and stuff, but what is nice about
flycheckis it integrates with
rubocoperrors in-place in the editor.
A picture is worth thousand words so:
pry --gemopens a pry session with
$LOAD_PATHand ‘require’s the gem. A good shortcut while working on gems and you want a quick console with the gem loaded.
ruby –S :
This can be used for running binaries which are present in local directory. For example, if you are working on
bundlerand want to run
bundlecommand with local version of bundler rather than one installed globally you can use:
ruby -S ./bin/bundle -I ./lib/ install
The advantages are:
ruby -Sallows you to ignore
#!/usr/bin/env rubyline and even if current version of ruby is X using
ruby -Syou can run the command with another version of Ruby. Especially useful for running scripts with JRuby, Rbx etc.
RUBYPATHenvironment variable running a script via
jruby -S) allows
PATHenvironment to be modified. For example running
jruby -S gemdoes not run
gemwhich is in current path, but it runs
gemcommand provided by JRuby because JRuby defines different
Faster rbenv load :
If you are using
rbenvand there is a lag while opening a new shell, consider updating the rbenv initializing line in your shell profile to:
eval "$(rbenv init - --no-rehash)"