Tag Archives: ruby

Select a Ruby Block (scope) in Sublime Text

Coming from PHP to Ruby you may wonder if there is a way to select Ruby ( or Ruby on Rails ) block scope that starts with things like begin or def and finishes with end In PHP it was possible using the commands like Expand Selection to Scope or Expand Selection to Block and in PHP it works nicely: But in the Ruby syntax neither of these items work. So how can you select a ruby block scope in Sublime Text 2 / 3 ? Easier than you might imagine: just use “Expand Selection to Paragraph” instead

Posted in Tech Tips | Tagged , | Leave a comment

`require’: cannot load such file — ruby-oci8 (LoadError)

If you are attempting to use the Oracle OCI8 gem with Ruby, and you have correctly followed the installation instructions, but you are getting a message like: `require’: cannot load such file — ruby-oci8 (LoadError) You may want to check your ruby script and make sure that you have this at the top: require ‘oci8’ Because even though the gem is named ruby-oci8 using this: require ‘ruby-oci8′ Will cause the error: `require’: cannot load such file — ruby-oci8 (LoadError)

Posted in Tech Tips | Tagged | Leave a comment

Install Slanger on Ubuntu 12

Slanger is an open source server implementation of the Pusher protocol written in Ruby. I wanted to install it on Ubuntu 12 but hit a few snags, so here’s how I got it working. First, it seems pretty imperative that you have a good ruby version manager (rvm) tool available. On Mac OS X I use rbenv but on Ubuntu I think the best one is the one from https://get.rvm.io and not the one from apt-get. So if you have installed the one from apt-get then it is probably best to remove it. Disclaimer – back up important files, blah bla blah, you should have some knowledge of linux, bla bla bla, I don’t know what you might accidentally delete while doing this. Be careful. To remove the old rvm: sudo apt-get –purge remove ruby-rvm sudo rm -rf /usr/share/ruby-rvm /etc/rvmrc /etc/profile.d/rvm.sh Then logout of the shell and/or reboot and run: env | grep rvm It should be blank, but if not try and find where the settings are coming from. I changed to the /etc/ directory and ran grep -Hil rvm and found that it was in the bash.profile there so i removed the environmental variables being set there, then logged out of my shell and logged in again. Once that is removed, you need to install the new version of rvm and from the website get.rvm.io the instructions say run this: \curl -L https://get.rvm.io | bash -s stable –ruby –autolibs=enable –auto-dotfiles That worked great, I think it installed ruby … Continue reading

Posted in Tech Tips, Web Development | Tagged , , , , | Leave a comment

Ruby on Rails: Setting up a new Application

Posted in Web Development | Tagged , | Leave a comment

rvm: how to install the latest version of ruby

Posted in Web Development | Tagged , | Leave a comment