0

Hi I have installed mt940 gem file and trying to access its methods as follows

require 'mt940'
#require 'mt940_parser'


class HomePageController < ApplicationController

  def aboutus
    #read all the files
     Dir.foreach(directory_path) do |item|
      puts item + "\n"
      MT940::Base.transactions(item)

      end

     end


 end

but um getting an error

NameError in HomePageController#aboutus
uninitialized constant MT940::Base

Um quite new to ruby on rails and I do not have a clue about it. If any one can help thank you

Álvaro González
  • 142,137
  • 41
  • 261
  • 360
not 0x12
  • 19,360
  • 22
  • 67
  • 133

2 Answers2

0

I also included MT940 parser gem along with MT940. Because of that I got a different implementation and once I removed MT940 parser it worked.

not 0x12
  • 19,360
  • 22
  • 67
  • 133
-1

Which gem are you using? some of the MT940 gems have a bit of a wired namespace and needs to required differently.

shameless promotion :) you might want to look into Cmxl - your friendly MT940 parser: https://github.com/railslove/cmxl

bumi
  • 111
  • 3