Ruby is an open-source dynamic object-oriented interpreted language created by Yukihiro Matsumoto (Matz) in 1993.
0
votes
0answers
3 views
Nested file upload problems with showing the url for the file in Amazon-s3
I have a an activeadmin+carrierwave app. I am trying to nest a file upload model called artwork into the order form. The form is creating fine but the show page is not showing the file link nor is it ...
0
votes
0answers
5 views
Ruby multithreading Performance issues
I am building Ruby application. I have a set of images that I want to greyscale. My code used to be like this:
def Tools.grayscale_all_frames(frames_dir,output_dir)
number_of_frames = ...
0
votes
1answer
8 views
Why is this recursion terminating (correctly) by rounding down the decimals to integers?
How is n being rounded down to integers in this example so that the terminators are effective??
For example with wonky_coins(5), the next round of recursion should call for wonky_coins(2.5), ...
0
votes
0answers
12 views
Run command on Rails Console startup
Is there a way to run a specific command when the rails console starts? I'd like it to print out whether or not I'm connected to the remote or local database in BIG LETTERS! I don't mind writing a ...
0
votes
0answers
6 views
Heroku + Rails 3.2 + PostgreSQL = NoMethodError: undefined method `result' for #<NoMethodError:..>
NoMethodError: undefined method `result' for #< NoMethodError: ...>
Stack trace refers to this place:
def current_income
return @current_income if defined? @current_income
if ...
0
votes
0answers
5 views
Rake task not working with postgresql and sinatra-activerecord
I was trying to setup facebook app locally, using ruby and sinatra, in Kubuntu 12.04.
I have included following gems in my gemfile. I have postgresql installed in my system and I am able to run the ...
0
votes
0answers
20 views
Rails 2.3.5 & ruby 1.8.7 issue while creating new application
I am using rails 2.3.5 & ruby 1.8.7. i am getting this error while creating the new application.
...
0
votes
0answers
7 views
VCR auto-rerecord not rerecording after first interval
I have a problem with auto rerecording of cassettes in vcr
This is my config:
VCR.configure do |c|
c.cassette_library_dir = 'spec/support/vcr_cassettes'
c.hook_into :fakeweb
end
and the call:
...
0
votes
0answers
10 views
Naming selenium grid nodes. Spawning a specific node
I'm trying to implement a kind of default queues in selenium hub.
There is a possibility to specify node's name (actually its environment, smth like "firefox on ubuntu" or "chrome on windows"). ...
1
vote
1answer
15 views
What is TOPLEVEL_BINDING in ruby?
It doesn't equal the binding at the main thread, what is this toplevel scope? What does this scope differ from the binding at the main thread?
> ruby -e 'puts TOPLEVEL_BINDING === binding'
false
0
votes
1answer
20 views
Rails undefined method `image' for error
I wanted to add to my rails app a new model:
rails g model Painting patient:references treatment:references image:string
I run migration, and then added some lines to the other controllers
In the ...
1
vote
2answers
22 views
Ruby: eval with string interpolation
I don't understand, why eval works like this:
"123 #{456.to_s} 789" # => "123 456 789"
eval('123 #{456.to_s} 789') # => 123
How can I interpolate into a string inside eval?
Update:
Thank ...
-1
votes
2answers
48 views
Are ruby regular expressios the right way to go?
I am working on a linguistics project in which I need to search for patterns within a text. I need to search for the following pattern: „ blah blah blah **target word** blah blah". In other words, ...
1
vote
1answer
22 views
Is it possible to load / require only one function form a large Ruby module?
I wrote a quite big ruby module, it loads in about 3-4 secs. Most of the times I need only one function from it. To speed up things, is it possible to load / require only that particular function form ...
0
votes
2answers
14 views
EventMachine send data to one client (From Multi Server )
I have developed multiple eventmachine servers which are like
require 'eventmachine'
module EchoServer
def post_init
puts "-- someone connected to the echo server!"
end
def receive_data data
...