Skip to content

Instantly share code, notes, and snippets.

Hello I am trying to install rails 3.0.0.beta3, when I run "gem install rails --pre" I get the following output:
Successfully installed rails-3.0.0.beta3
1 gem installed
Installing ri documentation for rails-3.0.0.beta3...
ERROR: While executing gem ... (Errno::ENOENT)
No such file or directory - lib
When I run "rails -v" I get the following output
CREATE TABLE IF NOT EXISTS `ofertas` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_parceiros` int(11) NOT NULL,
`data_inicio` datetime NOT NULL,
`data_termino` datetime NOT NULL,
`titulo` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`destaques` text NOT NULL,
`regulamento` text NOT NULL,
`apresentacao` text NOT NULL,
`qtd_vendidos` int(4) DEFAULT NULL,
function getValor($preco){
$valor = explode("." , $preco);
$valor = implode($valor);
$valor = ereg_replace(",",".",$valor);
return $valor;
}
@eniolopes
eniolopes / gist:901610
Created April 4, 2011 13:12
erro com should_receive rspec
it "monta 8 itens" do
@gerador.should_receive(:monta_conteudo_item).with(instance_of(Item)).exactly(8).times
@gerador.gerar_html #linha 72
end
Output:
monta 8 itens (FAILED - 1)
Failures:
class PotenciaDeQuatro
attr_reader :valor
def initialize(valor)
@valor = valor
end
def succ
PotenciaDeQuatro.new(@valor*4)
end
class Classe
def initialize(hash)
hash.each do |chave, valor|
p "#{chave}: #{valor}"
end
end
end
c = Classe.new({:nome => "Enio", :sobrenome =>" Lopes"})
class Lala < AR::Base
def set_has_many_belongs_to_relation(ids)
relatio.collection_ids = ids
end
end
def teste(a)
p a.object_id
a = 20
p a.object_id
end
b = 10
teste b #=> 21\n41
p b.object_id #=> 21
//egenda.js
var egenda = egenda || {
'construtores' : {},
'comportamentos' : {}
};
if(!('console' in window)){
(function() {
var metodos = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
public static DocumentReader[] GetReaders()
{
var db = new ReaderContainer();
var readers = new List<DocumentReader>();
foreach (var document in db.Documents)
{
readers.Add(new DocumentReader(document));
}
return readers.ToArray();
}