Questions tagged [uninitialized-constant]

104 questions
10
votes
2 answers

First Call to a Controller, Constant is defined, Second call, "uninitialized constant Oauth"?

I am trying to get the OAuth gem to work with Rails 3 and I'm running into this weird problem... (independent of the gem, I think I've run into this once before) I have a controller called "OauthTestController", and a model called "ConsumerToken". …
Lance
  • 75,200
  • 93
  • 289
  • 503
5
votes
2 answers

Rails -- uninitialized constant error for newly installed gems

I'm having trouble using newly installed gems - I think there must be something I'm missing, because I ran across the same error with both fb_graph and koala. I added the gem to my gemfile and then bundle installed it. I thought that was all you…
Kvass
  • 8,294
  • 12
  • 65
  • 108
5
votes
1 answer

Sudden "uninitialized constant PurIssue" error on STI_preload while upgrading rails to 7.0.1

I am in the process of upgrading a ~2 year old Rails app from 6.1 to 7.0.1 I have an STI setup where Pursuit is the main class and it has several other types as descendants: # app/models/pursuit.rb require 'sti_preload' class Pursuit <…
5
votes
2 answers

Error after upgrading Rails to 6.1: uninitialized constant RSpec::Rails::Railtie::SourceAnnotationExtractor

Running rspec after upgrading Rails results in an uninitialized constant error: RSpec::Rails::Railtie::SourceAnnotationExtractor. The backtrace points to the "rails_helper.rb" file. I already attempted a bundle update rspec-rails.
5
votes
3 answers

NameError Exception: uninitialized constant ActiveStorage::Attachment::ActiveStorage::Blob

I am trying to use my Rails database and keep running into this error. The database was working previously with no active storage issues until 5 days ago when it stopped and I started seeing this error: *** NameError Exception: uninitialized…
5
votes
3 answers

NameError uninitialized constant Model::Object

I'm new to ruby on rails. Ihe error I have is NameError in ReviewsController#create uninitialized constant User::Review Extracted source: @review = current_user.reviews.build(review_params) I read on other stack overflow questions that usually…
4
votes
2 answers

Uninitialized constant from the superclass

I have a FUU constante inside Foo and Foo2 classes, and in order to DRY my code, I moved a method inside the BaseStuff superclass. Just like this: class BaseStuff def to_s FUU end end class Foo < BaseStuff FUU = "ok" end class Foo2 <…
T5i
  • 1,470
  • 1
  • 18
  • 34
4
votes
1 answer

Uninitialized constant File::NOCTTY error when I require 'fakefs'

I am trying to use FakeFS but keep getting an uninitialized constant error when I require 'fakefs': C:/Ruby192/lib/ruby/gems/1.9.1/gems/fakefs-0.3.1/lib/fakefs/file.rb:26:in `': uninitialized constant File::NOCTTY (NameError) I was…
ThisSuitIsBlackNot
  • 23,492
  • 9
  • 63
  • 110
4
votes
1 answer

Getting "uninitialized constant" when trying to invoke my service in Rails

I'm using Rails 4.2.3. I have this line in a controller: service = XACTEService.new(“Event”, '2015-06-01', 'Zoo') The class in question is defined in app/services/XACTEService.rb. However upon visiting my controller, I get the…
Dave
  • 15,639
  • 133
  • 442
  • 830
4
votes
1 answer

Rspec expect raise_error ObjectDisabledException throws NameError exception

I have been using the watirspec-master files as examples to write my own RSpec tests. I recently encountered a situation in which I need to test for an exception thrown by a click or set event. I wrote the following test based on code in the…
Helioza
  • 147
  • 1
  • 1
  • 8
3
votes
1 answer

uninitialized constant Student::Net

I'm working on rails 3.0.4. I intend to send out sms to a particular number after saving students record. The code that I'm gonna mention below worked well in rails 2.X, but on rails 3.0.4, I get an error: NameError in StudentsController#create…
3
votes
1 answer

Invalid `Podfile` file: uninitialized constant

Adding identical pods to each target is redundant. def RedundantPod pod "Pod" end target 'targetOne' do RedundantPod end target 'targetTwo' do RedundantPod end The following setup throws an error…
Eric
  • 893
  • 10
  • 25
3
votes
1 answer

Can't push to Heroku because of DOTENV uninitialized constant error

I am trying to push my project up to Heroku. I have been using: gem 'dotenv-rails', :groups => [:development, :test] Because I am using recpatcha and need to export my keys to the app in development. When I try to push the code to heroku I…
Ryan Murphy
  • 842
  • 1
  • 9
  • 20
3
votes
2 answers

NameError: uninitialized constant -- activerecord

I have two classes, Number and Freebie: class Number < ActiveRecord::Base belongs_to :account has_many :freebies end class Freebie < ActiveRecord::Base belongs_to :number attr_accessible :name, :data has_attached_file :data, :path =>…
2
votes
1 answer

Default initialization of unused constant variable template

The following program: template const int n; is compiled successfully by gcc, but clang gives an error: # error: default initialization of an object of const type 'const int' const int n; ^ = 0 which makes…
cigien
  • 57,834
  • 11
  • 73
  • 112
1
2 3 4 5 6 7