Questions tagged [ruby-1.8.7]

For issues relating to developing in Ruby, version 1.8.7.

Use this specific tag along with the generic one: .

203 questions
2
votes
1 answer

Using durations as hash keys in Rails

Since I'm dealing quite a lot with durations in my Rails app, I would also like to use them as hash keys in some places. However, it does not seem to work as expected for me. Creating the initial hash works fine. For example, the following will…
dominos
  • 412
  • 1
  • 11
  • 21
2
votes
1 answer

Match unicode text with Ruby 1.8.7

I have a regex that is used for matching unicode string and works pretty cool with all versions of Ruby newer than 1.8.7: /[\p{L}\p{Space}]+/u How it can be achieved with Ruby 1.8.7?
Sergey Kishenin
  • 5,099
  • 3
  • 30
  • 50
2
votes
2 answers

Travis fails now Rails 4 has been released

Here's the relevant part of my gemspec: spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake" spec.add_development_dependency "rspec", "~> 2.13.0" spec.add_dependency "addressable" spec.add_dependency…
Pedro Nascimento
  • 13,136
  • 4
  • 36
  • 64
2
votes
5 answers

Reposition an element in an Array

Say I have... arr = ["a", "b", "c"] ...and I want to move "a" between "b" and "c". I currently do arr.delete("a") arr.insert(2, "a") Can I do that in a single operation? Thanks
dublxdad
  • 153
  • 1
  • 12
2
votes
1 answer

Ruby 1.8.7: Enumerator next complains about number of arguments

When I do the following in Ruby 1.9.3 (also JRuby, Rubinius...), it works as expected: enum = [1,2,3,4,5].each #=> # enum.next #=> 1 If I try the same thing on Ruby 1.8.7 with backports, the following thing…
moonglum
  • 801
  • 5
  • 13
2
votes
1 answer

How to Convert Microsoft Office "Smart" or "Curly" Quote/Apostrophe to ASCII or UTF-8 "Straight" Quote/Apostrophe in Ruby 1.8.7?

I'm using (and stuck with) the following version of Ruby: ruby 1.8.7 (2012-06-29 patchlevel 370) [x86_64-linux] I tried a lot of Googling, but I can't find a working answer to my problem. I'm importing a CSV file that will usually come from the…
Steven Hirlston
  • 1,869
  • 1
  • 15
  • 19
2
votes
1 answer

Ruby's `File.exist?` ThreadError

I am encountering errors when I am using Ruby's File.exist? method in middleware. I have no idea why. This is the background. I am improving some old webapp which hosts around 100GB of photos and growing. I need to replicate production environment…
skalee
  • 12,331
  • 6
  • 55
  • 57
2
votes
3 answers

Can't install ruby 1.8.7 on Mac 10.8 via RVM

I can't install ruby ree or ruby 1.8.7 on my Mac 10.8.2. I did that: $ brew install libksba $ brew update $ brew install autoconf automake $ brew tap homebrew/dupes $ brew install autoconf automake apple-gcc42 Then i try to install ruby 1.8.7 and i…
ExiRe
  • 4,727
  • 7
  • 47
  • 92
2
votes
0 answers

open uri error: can't convert hash into a string

I want to get an xml content from a url (let's say http://stackoverflow.com). For this I use open uri. When I do begin status = Timeout::timeout(5) { getresult = open("http://stackoverflow.com", "UserAgent" => "Ruby-OpenURI").read } rescue =>…
Sadiksha Gautam
  • 5,032
  • 6
  • 40
  • 71
2
votes
1 answer

Unable to store UTC time in MySQL table using rails

I am able to convert a local time in string format, to UTC time format. But when i save this utc time in my MySQL table, it is getting saved in a strange format. t_utc = Time.parse('Mon Apr 23 03:00:23 -0700 2012').utc # => Mon Apr 23 10:00:23 UTC…
serpent403
  • 803
  • 16
  • 32
1
vote
3 answers

ruby regexp - how to search for one word but not if another exists (in url/uri).?

How can I do a regexp in ruby 1.8 that matches: /my_dir/1/file but not if I have: /my_dir/1/deeper_stuff/file So far I have source_string = '/my_dir/1/index.html.erb' /^\/my_dir/.match(source_string) for the initial match, how do I add the…
Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
1
vote
1 answer

RVM install 1.8.7 on Monterey 12.0.1 Fails

Has anyone gotten ruby 1.8.7 working on Monterey with RVM? I've tried every solution reported out there and nothing seems to work for me. I know 1.8.7 is totally deprecated and unsupported but there are many out there still on this version. RVM…
oprogfrogo
  • 2,005
  • 5
  • 31
  • 42
1
vote
2 answers

Unable to install gems in ruby 1.8.7-p374

I am using ruby-1.8.7-p374, rubygems - 1.8.29 and rvm - 1.29.3 When I try to install any gem for example bundler, I get the following error While executing gem ... (RuntimeError) Marshal.load reentered at marshal_load
Anusha Bhat
  • 99
  • 1
  • 12
1
vote
1 answer

How to call and Handle request third party API in Ruby on Rails 2.3.5

I want to use third party API and want to make a put and post request and get the response from API in my Rails Application Ruby and Rails Version of My Application is Below - Current Version of Ruby -1.8.7 and Rails 2.3.5 May I know which Gem…
1
vote
1 answer

Ruby Openssl not being found in NET::HTTP

I'm getting the following error: /Users/user_name/.rbenv/versions/1.8.7-p375/lib/ruby/1.8/net/https.rb:124:in `use_ssl=': uninitialized constant Net::HTTP::OpenSSL (NameError) So, I opened up the https file and changed one thing just to see what…
Thermatix
  • 2,757
  • 21
  • 51