Wednesday, February 22, 2012

Gnome Shell shortcuts

There is an excellent cheat sheet/post about Gnome Shell at (go figure) gnome.org, http://live.gnome.org/GnomeShell/CheatSheet

I'll repost a quick summary here :

  • System (Windows) key: Switch between overview and desktop
  • Alt+F1: Switch between overview and desktop
  • Alt+F2: Pop up command dialog
  • Alt+Tab: Pop up application switcher
  • Alt+Shift+Tab: Cycle in reverse direction in the application switcher
  • Alt+[key above Tab]: Switch between windows of the same application in Alt+Tab
  • Ctrl+Alt+Tab: Pop up accessibility switcher
  • Ctrl+Shift+Alt+R: Start and end screencast recording
  • Ctrl+Alt+Up/Down arrow: Switch between workspaces
  • Ctrl+Alt+Shift+Up/Down arrow: Move the current window to a different workspace
  • Ctrl+Enter: Launch a shell command in a new Terminal window

Tuesday, February 21, 2012

Fedora 16, gnome-shell and rvm

I recently upgraded to Fedora 16.  There's lots to like.  There are some things that are annoying.

I found a couple of new oddities this evening after installing rvm.

First, rvm requires gcc, and gcc has to be installed.  I sort of assumed that gcc would have already been around.  Anyway,

sudo yum install gcc

did the trick. Second, after
  • installing rvm
  • logging out
  • logging back in
  • installing Ruby 1.9.2
  • installing the latest JRuby
  • logging out
  • logging back in

I ran :

rvm use jruby

I got :

RVM is not a function, selecting rubies with 'rvm use ...' will not work.

Huh?

There is of course an entry on the rvm site.  It's some gnome-terminal weirdness.  I was launching the terminal with Alt + F2.

Wednesday, February 8, 2012

RVM, jRuby, ActiveRecord::ConnectionNotEstablished, and PostgreSQL

I generated a new Rails 3 app with a PostgreSQL backend.  I was using the latest jRuby.

I started the server and got :

ActiveRecord::ConnectionNotEstablished

That was annoying.
I connected to the database from the command line and from another tool.
I ran rails console and got the following :

ArgumentError: syntax error on line 42, col 0: `'
                    load at org/yecht/ruby/YParser.java:152
                    load at /home/[USER NAME]/.rvm/rubies/jruby-1.6.5/lib/ruby/1.8/yaml.rb:134
  database_configuration at /home/[USER NAME]/.rvm/gems/jruby-1.6.5/gems/railties-3.2.1/lib/rails/application/configuration.rb:115


Taking a look at yaml.rb line 134 clued me in that I was using the wrong jRuby compatibility.

RVM to the rescue.  RVM is just pure goodness.  It really makes switching rubies a breeze.

The executive summary is that RVM makes it easy to run multiple versions of Ruby and/or Ruby gems.  To use jRuby :

rvm use jRuby

It even makes it easy to set jRuby's version compatibility.  RVM  allows you to specify hooks to run after its' methods.

jRuby 1.6.x has 1.8 and 1.9 Ruby compatibility.  To use 1.9 just add an "after_use" hook (this is detailed on the RVM site).