For issues relating to developing in Ruby, version 1.9.3. If your question applies to Ruby in general, use the tag [tag:ruby].
Questions tagged [ruby-1.9.3]
495 questions
137
votes
6 answers
Convert a string to regular expression ruby
I need to convert string like "/[\w\s]+/" to regular expression.
"/[\w\s]+/" => /[\w\s]+/
I tried using different Regexp methods like:
Regexp.new("/[\w\s]+/") => /\/[w ]+\//, similarly Regexp.compile and Regexp.escape. But none of them returns as I…

cmthakur
- 2,266
- 4
- 18
- 23
70
votes
9 answers
ruby-debug with Ruby 1.9.3?
I just updated to Ruby 1.9.3p0 and Rails 3.1.1. Now when I try to launch the server, it complains that I should install ruby-debug, even though it's already installed.
% rails server --environment=development --debug
=> Booting WEBrick
=> Rails…

dkobozev
- 2,265
- 2
- 21
- 21
58
votes
10 answers
Error installing debugger-linecache in Ruby 1.9.3
I need version 1.0.1 of debugger-linecache for a project, and I am facing the following error when trying to install.
trunk ☺ gem install debugger-linecache -v '1.0.1'
Building native extensions. This could take a while...
ERROR: Error installing…

Jordan Scales
- 2,687
- 4
- 28
- 37
52
votes
3 answers
Ruby on Rails "invalid byte sequence in UTF-8" due to bot
I have some errors triggered by a chinese bot: http://www.easou.com/search/spider.html when it scrolls my websites.
Versions of my applications are all with Ruby 1.9.3 and Rails 3.2.X
Here a stacktrace :
An ArgumentError occurred in listings#show:
…

CupraR_On_Rails
- 2,449
- 1
- 19
- 24
40
votes
3 answers
Confusion with Atomic Grouping - how it differs from the Grouping in regular expression of Ruby?
I have gone through the docs for Atomic Grouping and rubyinfo and some questions came into my mind:
Why the name "Atomic grouping"? What "atomicity" does it have that general grouping doesn't?
How does atomic grouping differ to general…

Arup Rakshit
- 116,827
- 30
- 260
- 317
35
votes
8 answers
How to cleanly initialize attributes in Ruby with new?
class Foo
attr_accessor :name, :age, :email, :gender, :height
def initalize params
@name = params[:name]
@age = params[:age]
@email = params[:email]
.
.
.
end
This seems like a silly way of doing it. What is a…

B Seven
- 44,484
- 66
- 240
- 385
32
votes
2 answers
When should I use an OpenStruct instead of a Hash?
I like the "definition of arbitrary attributes" and I think the OpenStruct in ruby sometimes feels cleaner than using a hash, but I'm curious as to whether there are other specific advantages or use cases that make an OpenStruct a better choice than…

mkelley33
- 5,323
- 10
- 47
- 71
29
votes
2 answers
ActiveRecord objects in hashes aren't garbage collected -- a bug or a sort of caching feature?
I have a simple ActiveRecord model called Student with 100 records in the table. I do the following in a rails console session:
ObjectSpace.each_object(ActiveRecord::Base).count
# => 0
x =…

AmitA
- 3,239
- 1
- 22
- 31
27
votes
2 answers
Error while installing Ruby 1.9.3
I have an error while installing Ruby 1.9.3 through rvm.
rvm install 1.9.3-p0
Installing Ruby from source to: /home/alder/.rvm/rubies/ruby-1.9.3-p0, this may take a while depending on your cpu(s)...
ruby-1.9.3-p0 - #fetching
ruby-1.9.3-p0 -…

zishe
- 10,665
- 12
- 64
- 103
23
votes
3 answers
gem install pg can not bind to libpq
After upgrading to Ruby 1.9.3 (from 1.9.2 using system RVM) on Ubuntu 10.04.3, I removed all of my gems, and attempted to reinstall pg (ala bundle install pg).
It then threw an error and informed me that I should look at mkmf.log, both of which are…

Sam Whited
- 6,880
- 2
- 31
- 37
22
votes
4 answers
Bundler could not find compatible versions for gem, updating Rails app
After createing a brand new rails app Following the official rails blog post, attempting to convert apps to rails 3.2.0.rc2 yields the following
Updated Gemfile to depend on rails ~> 3.2.0.rc2
gem 'rails', '~>3.2.0.rc2'
Updated Gemfile to depend…

rudolph9
- 8,021
- 9
- 50
- 80
21
votes
7 answers
How to install Compass on Windows
I have installed Ruby on my system, and now I want to install Compass. But when I execute the gem install compass command, it shows an error like this:
could not find valid gem 'compass' <>=0> in any repositary
And also:
SocketError: getadressinfo:…

hsnGunda
- 347
- 1
- 5
- 20
20
votes
3 answers
Error running 'bundle install' using Ruby 1.9.3
I'm going through the second edition of Ruby on Rails Tutorial (http://ruby.railstutorial.org/). I'm following each step, so I'm using Ruby 1.9.3 and when I run 'bundle install' inside my Rails project I an error with a big trace of the error which…

Sebastian Sogamoso
- 333
- 1
- 3
- 9
18
votes
3 answers
install ruby 1.9.3 using rvm on ubuntu
Possible Duplicate:
Ruby 1.9.2 and Rails 3 cannot open rails console
I have already installed rvm and ruby 1.9.2, both working properly. Using rvm version 1.10.2. I previously installed the rvm packages readline/zlib, but now I'm having big…

CLod
- 917
- 2
- 11
- 28
18
votes
6 answers
How to set SameSite attribute to 'None; Secure' in Rails3.1.12 and Ruby1.9.3
A cookie associated with a cross-site resource at https://example.com/ was set without the SameSite attribute. It has been blocked, as Chrome now only delivers cookies with cross-site requests if they are set with SameSite=None and Secure. You can…

Suresh Kumar
- 169
- 1
- 1
- 4