Questions tagged [ruby-1.9]

Ruby 1.9 is a shortcut for ruby versions 1.9.1, 1.9.2 and 1.9.3. Ruby is a dynamic language that focuses on simplicity and expressiveness.

Ruby is a dynamic language that focuses on simplicity and expressiveness.

Ruby 1.9 is the successor of Ruby version 1.8, there are the subversions 1.9.1, 1.9.2 and 1.9.3. The successor Ruby 2.0 was published 2013-02-24.

Ruby 1.9 is incompatible with Ruby 1.8, the succcessor Ruby 2.0 is intended to be fully backward compatible with Ruby 1.9.3.

Ruby 1.9 introduced new features like:

  • Per-string character encodings are supported
  • Block local variables (variables that are local to the block in which they are declared)
  • An additional lambda syntax
  • New socket API (IPv6 support)
  • require_relative import security
429 questions
0
votes
2 answers

How to Call/Require Ruby 1.8 Lib from Ruby 1.9

I'm using a Ruby 1.8 lib kakasi-ruby, but it seems that it can only be compiled against Ruby 1.8 (https://github.com/hogelog/kakasi-ruby/issues/2) My application is Ruby 1.9.3, so I need to call kakasi-ruby from Ruby 1.9.3. How should I do? Do I…
Peter Lee
  • 12,931
  • 11
  • 73
  • 100
0
votes
3 answers

Rspec fields in context scope

Didn't really know how to phrase the title but my problem is as follows: shared_examples "something" do context "for something" do fields.each do |field| it "should have #{field} field" do #Check something end end …
Guu
  • 911
  • 1
  • 9
  • 14
0
votes
1 answer

Feed Encoding Problems Ruby 1.9

i am trying to parse rss/atom-feeds in my rails app, but i encountered some serious problems with non-ASCII characters, eg. the german umlauts ÄÖÜ or ß. Some feeds in the wild use proper UTF-8, but some others make me cry. The general Problem is:…
Maximilian Stroh
  • 1,086
  • 1
  • 10
  • 26
0
votes
1 answer

Parsing date in Ruby

I need a date of birth as a plain text in Ruby on Rails application. So here is the main part of a code I'm using to do it if @date_of_birth_as_text.present? and Date.parse(@date_of_birth_as_text).nil? errors.add :date_of_birth_as_text,…
user266003
0
votes
1 answer

Running Metrical with 1.9 Hash Syntax

I want to use Metrical with my brand-new Rails project using Ruby 1.9 hash syntax doing things like before_filter :guest_user, only: [:new, :create] before_filter :correct_user, only: :destroy and I get this…
bento
  • 2,079
  • 1
  • 16
  • 13
0
votes
1 answer

Find all models across all namespaces

I want to find all models in all namespaces. Ideas I've considered: Object.constants is not working a good starting point because it does not find my namespaced modules. So this answer isn't working for me. ObjectSpace is a possibility but I'd…
David J.
  • 31,569
  • 22
  • 122
  • 174
0
votes
1 answer

How do I move from SOAP:RPC:Driver to Savon

As discussed elsewhere the SOAP::RPC::Driver which was available in Ruby 1.8 has been removed in Ruby 1.9. People suggested using the Savon gem, but I can't find any tutorials on how to convert existing code, specifically for endpoints for which…
davetapley
  • 17,000
  • 12
  • 60
  • 86
0
votes
1 answer

Ruby 1.9.1 Installation on Debian

Currently having a bit of a nightmare trying to run code on another machine. I've been developing a Sinatra app as part of an internship I'm doing. I'm developing on an Ubuntu 12.04 machine, with ruby1.9.3 (through RVM). My supervisor wants to run…
Richard Stokes
  • 3,532
  • 7
  • 41
  • 57
0
votes
1 answer

Getting "invalid byte sequence in US-ASCII" when I try to upload a file in Ramaze and Ruby 1.9

I guess the default encodings have changed with 1.9, but I thought Ramaze was supposed to be fully 1.9 compatible? I'm really not sure what going on here. Thanks for any help!
Phil Kulak
  • 6,960
  • 8
  • 45
  • 50
0
votes
1 answer

The New Way To Do This (ActiveRecord Aggregations)

I have been learning ActiveRecord from the book Pro Active Record: Databases With Ruby And Rails. The book is a little bit outdated (published in 2007), but I have had no problems with it so far until I had gotten up to aggregations. The code I have…
Bobby Tables
  • 1,154
  • 4
  • 15
  • 25
0
votes
1 answer

Ruby class based on BasicObject can't access code in other module

I'm using method_missing to define a class for namespacing constants in a vocabulary. To be effective, I need the vocabulary class to inherit from BasicObject, otherwise none of the standard object methods are available as vocabulary terms (because…
Ian Dickinson
  • 12,875
  • 11
  • 40
  • 67
0
votes
1 answer

Why can't I get my ruby require's to work properly?

Possible Duplicate: Why does Ruby 1.9.2 remove “.” from LOAD_PATH, and what's the alternative? Require command not working within bash irb on Snow Leopard Ruby require call fails on custom code I'm running: OS X 10.6.8 RVM 1.12.3 with Ruby…
Alex Coplan
  • 13,211
  • 19
  • 77
  • 138
0
votes
1 answer

Ruby: How to get colors in testrb

Is there any way to get colors via testrb that does not involve adding test-unit to the gemfile and using bundle exec on 1.9 (everything colored in 1.8)? ruby test/xxx_test.rb -> colors testrb test/xxx_test.rb -> no colors Add test-unit to the…
grosser
  • 14,707
  • 7
  • 57
  • 61
0
votes
2 answers

Don't know how to make search form in rails 3

I need a search form in my rails 3.2.3 application, but i don't know how to do this, yesterday i had it fixed but then i deleted it :(. Here are my Controller and Model: Controller class BedrijfsgegevensController < ApplicationController def…
Kees Sonnema
  • 5,759
  • 6
  • 51
  • 106
0
votes
2 answers

Undefined method, MIDI

I have been working with the book Practical Ruby Gems. It gave me the code below, which I wrote in: require 'dl/import' class LiveMIDI ON = 0x90 OFF = 0x80 PC = 0xC0 def initialize open end def noteon(channel, note, velocity=64) …
Bobby Tables
  • 1,154
  • 4
  • 15
  • 25
1 2 3
28
29