Project

General

Profile

CDO gem in Ruby2.2.2 & Rails4

Added by jay qiu almost 9 years ago

Hi, I am using CDO Ruby gem with Rails 4,
but Rails shows "CDO did NOT run successfully!" when I test my code.
Hope there is someone can advance me, thanks!

I installed gem cdo and rb-gsl
Here is my code :

require "cdo"
require "gsl"

class foo

def bar
file = open("file.nc")
@cdo_name = Cdo.showname(in: file)
end

end

By the way, I am using Ruby 2.2.2 and Ubuntu 14.04, CDO command "cdo showname file.nc" works in terminal.


Replies (3)

RE: CDO gem in Ruby2.2.2 & Rails4 - Added by Ralf Mueller almost 9 years ago

Hi!

The interface you use, only valid for releaes older 1.2.0. I don't know, which cdo.rb release you arae using, but if its newer, you have to use

Cdo.showname(input: file)

or
Cdo.showname(:input => file)

You might have a look into the ruby tests at https://github.com/Try2Code/cdo-bindings/blob/master/ruby/test/test_cdo.rb

hth
ralf

RE: CDO gem in Ruby2.2.2 & Rails4 - Added by Ralf Mueller almost 9 years ago

for debugging purpose, you should use

Cdo.debug = true

RE: CDO gem in Ruby2.2.2 & Rails4 - Added by jay qiu almost 9 years ago

Hi, Ralf

Thanks very much, it works !

Best,

jay

    (1-3/3)