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
3
votes
1 answer

ajax call when something else is happening in the background

I am trying to display the progress percentage when i upload a file and unzip it. I am using ruby-zip to unzip the file. While unzipping I increment the counter and store it in database. I have a form like <% form_tag '/unzip', :multipart => true…
Sadiksha Gautam
  • 5,032
  • 6
  • 40
  • 71
3
votes
1 answer

rake asset:precompile takes 28 minutes on 1.9.2

I have a pretty large rails app (Rails 3.2.3), using the asset pipeline. There are are quite a few files in the assets folder. Under 1.8.7, running rake assets:precompile takes 4 minutes. This is long, but due to the sheer number of assets I'm…
Ben Scheirman
  • 40,531
  • 21
  • 102
  • 137
3
votes
2 answers

Rspec link_to - including confirm/data-confirm attribute causes test to fail

I have a link as follows that I'm trying to test (please ignore the square brackets): [%= link_to "Delete User", destroy_user_account_path(@profile.user), :class => "delete", :confirm => "a", :title => "Delete #{@profile.user.name}", :method =>…
Reb
  • 649
  • 1
  • 8
  • 12
2
votes
1 answer

ruby .map! or each for modifying an array in place

I have the following: article_results.keys do |key| article_results[key].map! do |a| a[:filename] = c.filename a[:sitename] = c.site_name a end end As I want to add to each element of each array within the hash dynamically, but for…
Thermatix
  • 2,757
  • 21
  • 51
2
votes
1 answer

Rescuing LoadError in Rails application

In my Rails 3 app, I am fetching path_info by: Rails.application.routes.recognize_path(url, { :method => request.request_method }) rescue {} If a crawler hits a URL like "http://localhost:3000/admin_", the above code raises following…
Utsav Kesharwani
  • 1,715
  • 11
  • 25
2
votes
0 answers

Ruby: Unicode issues with DBI gem

Why would a unicode encoding get lost when sending it to an ODBC-interface via the dbi-gem? We wrote an sinatra-application that connects via DBI to an SAP HANA database. The latter shouldn't matter as I can manually execute Statements with UTF8…
friedrich
  • 2,095
  • 1
  • 11
  • 12
2
votes
1 answer

Dreadfully slow CSV generation

Preface: We are working hard to upgrade our apps Ruby and Rails versions, but need to work with what we're on at the moment. We have functionality to export data to CSV in our RoR app. We recently upgraded to Ruby 1.8.7, Rails 3.1, and the…
ilasno
  • 714
  • 1
  • 13
  • 31
2
votes
1 answer

undefined method `double' for

I have problem with using rspec-mocks. bundle list shows: Gems included by the bundle: * CFPropertyList (2.2.8) * builder (3.2.2) * bundler (1.7.12) * ci_reporter (1.9.3) * diff-lcs (1.2.5) * excon (0.44.0) * facter (2.4.0) * hiera…
kendriu
  • 565
  • 3
  • 21
2
votes
3 answers

visiting hash with keys from array

I have a big hash with lots of nested key value pairs. Eg. h = {"foo" => {"bar" => {"hello" => {"world" => "result" } } } } Now I want to access result and I have keys for that in array in proper sequence. keys_arr = ["foo", "bar", "hello",…
shivam
  • 16,048
  • 3
  • 56
  • 71
2
votes
3 answers

Right way to check if a constant is already defined in a Ruby Class

I have certain classes that are implemented as decorators in my Rails app which is on Ruby 1.8.7 . I keep getting the warning - warning: already initialized constant ABC . Here ABC is the name of the constant. To solve this, I'm using the…
boddhisattva
  • 6,908
  • 11
  • 48
  • 72
2
votes
3 answers

"ERROR: Failed to build gem native extension" when installing Cucumber 0.93

When I try to install cucumber 0.93 this error is triggered. I need to install this specific version. trabajo@fernando-Inspiron-1545:~/cucumber-rspec$ gem install cucumber -v 0.9.3 Building native extensions. This could take a while... ERROR: …
juan perez
  • 323
  • 5
  • 14
2
votes
2 answers

TypeError: Google is not a module

Im trying to implement google youtube api in my ruby on rails project as stated in youtube documentation https://developers.google.com/youtube/v3/code_samples/ruby#retrieve_my_uploads so this block of code require 'google/api_client' I get the…
Nasser
  • 23
  • 3
2
votes
2 answers

Why does Ruby gsub not replace a second occurrence of this pattern?

I have a bit of code for escaping double-quotes from a string which may include pre-escaped quotes; e.g: This is a \"string" Using the following code with Ruby 1.8.7p374: string.gsub!(/([^\\])"/, '\1\"') However, I get some funny edge-case when…
GeReV
  • 3,195
  • 7
  • 32
  • 44
2
votes
2 answers

Ruby - Select modified values from array based on some condition

I know how select, collect and map work in Ruby. I was just wondering if there is a similar native Ruby method that can combine them & give results in a single iteration without having the need to remove nil from array? For ex. (1..10).map { |x| x*3…
Utsav Kesharwani
  • 1,715
  • 11
  • 25
2
votes
1 answer

Net::HTTP not sending request

I have the following method in our Ruby 1.8.7 project: def self.ping_server request_data = get_request_data uri = 'another_server.our_company.com' https = Net::HTTP.new(uri) https.use_ssl = true path = "/our_service" data =…
Kevin
  • 14,655
  • 24
  • 74
  • 124
1 2
3
13 14