Andrew Colclough

Web Design & Dev., Liberty, Economics, Football

Annoyed by Ruby Gem 1.8.2 Notes about Deprecation?

Such as:

NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on or after 2011-10-01.

Try running:
gem pristine --all --no-extensions
That wiped them out for me. 

 

Filed under  //   annoying   deprecated   gems   note   ruby  

Rails 3 and Restful Authentification Routing Error?

I was trying to set up a plugin for Rails (v.3) called Restful Authentication and I was getting the following routing error:

"Routing Error uninitialized constant ApplicationController::AuthenticatedSystem"

Luckily, found a tip here by user 'Croplio' that worked for me.

Try the following in your application_controller.rb file:

class ApplicationController < ActionController::Base
  require File.join(Rails.root, 'lib', 'authenticated_system.rb')
  include AuthenticatedSystem
end
Score.

Filed under  //   AutheticatedSystem   ERROR   Restful Authentification   coding   rails 3   routing   ruby   tip  

Sinatra - a tiny web framework.

require 'rubygems'
require 'sinatra'
get '/hi' do
  "Hello World!"
end

$ gem install sinatra
$ ruby hi.rb
== Sinatra has taken the stage ...
>> Listening on 0.0.0.0:4567
Framework Here: sinatrarb.com

Here's a super duper lightweight web application framework I am fooling around with - with the help of Noonat. ;)

Filed under  //   framework   lightweight   ruby   sinatra  

Compass: A Real Stylesheet Framework

I am currently testing this system out - and so far I have been totally blown away. I think Compass+Sass are a huge leap forward in the CSS arena. If you get the opportunity - watch this full video to get a good overview of some of the power that Compass and Sass could add to your web design/dev project.

Here are links to both Frameworks to get you started:
-Sass
-Compass

And as Samuel L. Jackson once said, "Hold on to your butts."

Filed under  //   blueprint   compass   compile   css   cutting-edge   framework   ruby   sass   web design   web developement  

ERROR: could not find [gem] locally or in a repository

gem install --system

I ran into this issue the other day and the above code worked. You may or may not need to run "sudo gem update --system" of course if you get a permissions problem.

Also - if you need to get a little info about your installation and/or version of gems:

"gem env"

Filed under  //   --system   ERROR   gems   install   repository   ruby   tip  

taxIncreaseOrNot.rb

Just to clarify:

#!/usr/bin/env ruby -wKU
#taxIncreaseOrNot.rb
question = "Is it a tax increase?"
currentTax = 5
bushTaxCut = -2

newTax = currentTax - bushTaxCut
taxChangeAmmount = newTax - currentTax

if newTax > currentTax
  taxChange = "increase"
  puts question
  puts "You will now pay $#{newTax}, which is a tax #{taxChange} of $#{taxChangeAmmount} from $#{currentTax}. What the tax was in the past is not information nessasary to answer the question."
else
  puts "Nancy is right. $#{newTax} is somehow not greater than $#{currentTax}. However, the laws of logic and mathematics are no longer in effect - so we're all totally screwed."
end

Which returns:

Results

Filed under  //   Nacy Pelosi   logic   math   ruby   tax