For issues relating to developing in Ruby, version 1.9.2. If your question applies to Ruby in general, use the tag [tag:ruby].
Questions tagged [ruby-1.9.2]
234 questions
14
votes
12 answers
(Object doesn't support #inspect)
I have a simple case, involving two model classes:
class Game < ActiveRecord::Base
has_many :snapshots
def initialize(params={})
# ...
end
end
class Snapshot < ActiveRecord::Base
belongs_to :game
def initialize(params={})
# ...
…

explainer
- 1,345
- 3
- 11
- 25
14
votes
1 answer
capybara - Find with xPath is leaving the within scope
I am trying to build a date selector with Capybara using the default Rails date, time, and datetime fields. I am using the within method to find the select boxes for the field but when I use xPath to find the correct box it leaves the within scope…

Nick
- 600
- 1
- 5
- 13
12
votes
5 answers
Need help setting up passenger with RVM
I'm trying to setup passenger with rvm. I keep getting this error
Your RVM wrapper scripts are too old.
Please update them first by running
'rvm update --head && rvm reload &&
rvm repair all'.
I did that still same problem
GNU C++…

Antarr Byrd
- 24,863
- 33
- 100
- 188
12
votes
4 answers
Rails server won't start because of new relic error
When I try to start my Rails server, I am getting the following error:
I am using ruby 1.9.2
=> Booting WEBrick
=> Rails 3.1.8 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown…

Tony
- 10,088
- 20
- 85
- 139
10
votes
1 answer
collection_select method gives error in Rails 3.1.1
I have a Model called Category and other Model Product. They have has_many and belongs_to relation.
But code in my view
<%= f.collection_select(:product, :category_id, Category.all, :id, :name)%> is giving me undefined method `merge' for…

Bhushan Lodha
- 6,824
- 7
- 62
- 100
10
votes
2 answers
undefined method `copy' for File:Class
I've just upgraded a project to Ruby 1.9.2 and the following line crashes the app with 'undefined method `copy' for File:Class'
File.copy(animage.image.path(:export), destfile)
I have the following libraries loaded in this module
require…

creativetechnologist
- 1,452
- 13
- 29
10
votes
2 answers
Cleanup old refs in Ruby Version Manager (RVM)
I need to free disk space on my local machine, which is almost allocated into my Ruby Version Manager (RVM) dir.
Now, it seems I got just one ruby version ( 1.9.2p136 ) :
lsoave@ubuntu:~/rails/github/gitwatcher$ ruby -v
ruby 1.9.2p136 (2010-12-25…

Luca G. Soave
- 12,271
- 12
- 58
- 109
9
votes
3 answers
How do I Install Ruby 1.9.2 with RVM on Mac OSX 10.7.3 LION?
I am following the Ruby on Rails tutorial and I'm hung up on installing Ruby 1.9.2. It has been stuck at the #compiling function for ~36 hours. I tried to find my configure.log file but I honestly haven't been able to.
What I have done so far:
1)…

Vincent Barr
- 91
- 1
- 5
9
votes
3 answers
Resque: one worker per queue
I currently have a Rails 3.0 project, with Ruby 1.9.2 and Resque.
My application has multiple worker classes and multiple queues, that are dynamically created (during runtime). Also, there are multiple workers started that are free to work on any…

Henrique Zambon
- 1,301
- 1
- 11
- 20
9
votes
1 answer
Ruby 1.9.2 export a CSV string without generating a file
I just can't get the 'To a String' example under 'Writing' example in the documentation to work at all.
ruby -v returns:
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]
The example from the documentation I can't working is…

Dubbs
- 93
- 1
- 5
7
votes
1 answer
How to write gsub with curly quotes for UTF-8 strings?
I am writing an extension method for the String class to clean up non-ASCII characters. The strings that I am cleaning are UTF-8.
When using non-ASCII characters in a file, the console will not start because it is interpreting the curly quotes as…

B Seven
- 44,484
- 66
- 240
- 385
7
votes
1 answer
Extract the AST from a Ruby block
Is it possible to grab the AST of a block from Ruby itself?
I've had a look at both ParseTree and ruby_parser, but they both seem to have sketchy support (from what I've read) for Ruby 1.9.2. I need something that works well with 1.9.2.
user47322
7
votes
1 answer
Rails 3.1 Not Reloading Changed Views
I'm seeing a bug/feature in my Ruby 1.9.2 applications. Any changes to views (not ruby files) require a server restart. I initially encountered this in a Rails app, but I've tested the same thing in a minimal Sinatra app too.
I'll include a simple…

Eric Hu
- 18,048
- 9
- 51
- 67
7
votes
2 answers
single table inheritance with embeds_one mogoid
I have a model
class Post
include Mongoid::Document
include Mongoid::Timestamps
embeds_one :comment
end
and I have comment class
class Comment
include Mongoid::Document
include Mongoid::Timestamps
embedded_in :post
field :title
…

Sadiksha Gautam
- 5,032
- 6
- 40
- 71
7
votes
2 answers
Addition error with ruby-1.9.2
When I add 0.1+0.2 I am getting 0.30000000000000004 but when I add the same number in ruby 1.8.7 I am getting the correct answer 0.3. I get 0.3 by rounding but I just want to get 0.3 on ruby 1.9.2 by adding 0.1 and 0.2

Sadiksha Gautam
- 5,032
- 6
- 40
- 71