uninitialized constant Ebics::Client
ternes3 opened this issue · 11 comments
Hey,
i´m new on ruby and currently I try to integrate ebics with this gem. I just followed the introduction placed in the readme and get this error: uninitialized constant Ebics::Client
any ideas?
thanks
ternes3
are you using bundler? or writing some script without?
can you try Epics::Client
, which is the name mentioned in the README, altough Ebics
should also work.
I am using bundler, with Epics
it run into cannot load such file -- epics
. Mixed up with require "ebics"
and Epics::Client
it end up in uninitialized constant MyClass::Epics
.
within a rails app?
or a custom script? -> how are you requiring the bundle then?
are you using epics
or ebics
?
Yes, its inside an rails app.
Gemfile -> gem 'epics'
Well, actually i tried everything with ebics
, but you comment recently:
can you try Epics::Client
so now im using epics. My Controller looks like:
require "epics" //error line when require "epics" cannot load such file -- epics
class InitController < ApplicationController
def index
e = Epics::Client.setup("my-super-secret", "https://ebics.sandbox", "SIZBN001", "EBIX", "EPICS") //error line when require "ebics" uninitialized constant InitController::Epics
...
end
end
hm...
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
def foo
render text: Epics::Client
end
end
works on a new generated rails app.
although i'm pretty sure you've done all that, just to reduce failure options:
- bundle is installed?
- server restarted?
- spring is stopped?
ok, i just copied your example controller, same result.
Bundle is installed and the server is restarted. Spring was running. Unfortunately without spring it results in the same error.
puh... what else is in the Gemfile? Can you provide it to me?
sure, actually it is the gemfile generated with rails new ...
added epics and unicorn, removed spring (yep i run spring stop on my project).
source 'https://rubygems.org'
gem 'epics'
gem 'rails', '4.2.6'
gem 'sqlite3'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'bcrypt', '~> 3.1.7'
gem 'unicorn'
group :development, :test do
gem 'byebug'
end
i've pushed the complete sample app and used your Gemfile... still works.
can you check it out and maybe find some differences between those two?
thanks very much kangguru, the solutions is simple. The difference is the line require 'epics', it just seems not to be necessary, without the application works fine.
ok, although that should not change something :) happy it now works for you!
happy easter 🐰