uninitialized-constant

uninitialized constant SessionsController in API

笑着哭i 提交于 2019-12-13 03:24:13
问题 I'm writing an API and am trying to login with the API and am getting uninitialized constant SessionsController error followed by the tip to "Try running rake routes for more information on available routes." when I try to go to the URL http://localhost:3000/api/v1/login as a POST My routes show that the route and action exist as shown: api_v1_users GET /api/v1/users(.:format) api/v1/users#index {:format=>"json"} POST /api/v1/users(.:format) api/v1/users#create {:format=>"json"} new_api_v1

Getting “uninitialized constant” when trying to invoke my service in Rails

巧了我就是萌 提交于 2019-12-10 10:55:46
问题 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 error: uninitialized constant MyObjectsController::XACTEService However, I have added this into my config/application.rb file class Application < Rails::Application config.autoload_paths += %W(#{config.root}/services) So I don’t understand why the controller is failing

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

谁说胖子不能爱 提交于 2019-12-07 13:49:43
问题 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 noticed this error message: remote: ! NameError: uninitialized constant Dotenv So I commented out the Dotenv gem and any Dotenv variables in the app. I ran $ bundle exec rake -P Then tried the push again. I am still getting the same error from Heroku. Do I

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

和自甴很熟 提交于 2019-12-06 03:40:39
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 noticed this error message: remote: ! NameError: uninitialized constant Dotenv So I commented out the Dotenv gem and any Dotenv variables in the app. I ran $ bundle exec rake -P Then tried the push again. I am still getting the same error from Heroku. Do I need to reset my gemfiles somehow? Ok, so the answer in the end was that I needed to change gem 'dotenv

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

怎甘沉沦 提交于 2019-12-05 16:42:42
问题 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". The model looks like this. require 'oauth/models/consumers/token' class ConsumerToken < ActiveRecord::Base include Oauth::Models::Consumers::Token end When I go to "/oauth_test/twitter", it loads the Oauth::Models::Consumers::Token module and I'm

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

烈酒焚心 提交于 2019-12-04 03:00:50
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". The model looks like this. require 'oauth/models/consumers/token' class ConsumerToken < ActiveRecord::Base include Oauth::Models::Consumers::Token end When I go to "/oauth_test/twitter", it loads the Oauth::Models::Consumers::Token module and I'm able to connect to twitter no problem. But the second time I try it (just refresh the /oauth_test/twitter