I'm attempting to get Thinking Sphinx working w/ Delayed Jobs but I am not having any success. I keep getting the following error:
uninitialized constant ThinkingSphinx::Deltas::DelayedDelta
I have thinking-sphinx (2.0.2), delayed_job (2.1.3), and ts-delayed-delta (1.1.1) installed. I have restarted sphinx using rake ts:restart. I don't really know what else to try. Any suggestions?
Hey Kyle, I'm using the exact same stack with no problems whatsoever.
Please, make sure you have something like this in your Gemfile:
gem 'ts-delayed-delta', '1.1.1', :require => 'thinking_sphinx/deltas/delayed_delta'
If that doesn't help it'd be nice if you provided us with some more context. Backtrace would be nice.
Related
I'm trying to get ApiAuth working with ActiveResource and having no luck. The documentation suggests this as the way to use the gem:
class Foo < ActiveResource::Base
with_api_auth("foo", "bar")
end
This results in the following error:
NoMethodError: undefined method `with_api_auth' for Foo:Class
I know that the api_auth library is available because when I do
require 'api_auth'
i get "false", which I believe means that the library/gem was already loaded.
Additionally, I picked out the module/class where with_api_auth is defined and don't get an error:
2.3.8 :004 >
ApiAuth::Rails::ActiveResourceExtension::ActiveResourceApiAuth
=> ApiAuth::Rails::ActiveResourceExtension::ActiveResourceApiAuth
2.3.8 :005 >
I found a couple issues for this exact error on the api_auth github project, but neither had solutions that worked for me.
Anyone else see this error or know how to eliminate it?
So in the end it was an ordering of gems in my Gemfile that made the difference. It ended up being an ordering issue in my Gemfile. I found an issue (113) on the gem github issues list that said to make sure the order was right by doing:
gem 'activeresource'
gem 'api-auth'
Originally this hadn't worked and it ended up being because you no longer have to explicitly put activeresource in your Gemfile. So I moved gem 'api-auth' the last line in my Gemfile and everything worked.
I don't know for sure, but I think it has to do with how mixins are loaded on bundle install. "think" being the most important word in that statement.
I've been having major problems with the airbrake gem that is seriously impeding my work flow lately. As an example, I am working on some front end stuff with coffeescript. When I make an error like a typo or anything, I get this error message:
As you can see from the image, this does not help me at all whatsoever and it takes me absolutely forever to figure out what's wrong. A second example is running a rake test.
When I have airbrake and run rake test, if I were to say have something wrong with mhy configuration, I get this horrible long string of text that looks like this:
Basically what the picture is saying is that I didn't specify the name of my localhost test database but you wouldn't necessarily know that based on the errors that airbrake yields.
In my airbrake.rbg I have the following configuration settings:
Airbrake.configure do |config|
config.project_key = ENV['AIRBRAKE_API_KEY']
config.host = "#{ENV['AIRBRAKE_HOST']}:#{ENV['AIRBRAKE_PORT'].to_i}"
config.project_id = ENV['AIRBRAKE_PROJECT_ID']
config.ignore_environments = %w(development test)
end
class Airbrake::Sender
def json_api_enabled?
true
end
end
As you can see, I should have airbrake configured correctly to ignore both my test and development database but this is not working. Has anyone had this problem before. I would really love to fix this once and for all so its not a huge problem anymore. Any help would be appreciated, thanks.
This looks like it is a bug in an older version of Airbrake that has been resolved in newer versions.
Try updating Airbrake in your Gemfile to the latest version.
gem 'airbrake', '~> 5.5'
I have installed the time_splitter gem so that I can use a single date_time field. My bundle includes version 1.0.0. As recommended here, I added this code to my class Sheet:
extend TimeSplitter::Accessors
split_accessor :event_time
I am getting an error on the extend:
NameError in SheetsController#new
uninitialized constant Sheet::TimeSplitter
I'm about to give up and hack together a date/time solution but was hoping for something more elegant. Thanks in advance for your help.
You need to restart your server. Happened to me :)
I'm sure this is an easy question but I'm having a hard time figuring out what to Google.
I'm trying to use the library ChunkyPNG.
I added it to my Gemfile and did a bundle install.
bundle list | grep "chunky"
* chunky_png (1.2.5)
So far so good.
I try using it in my controller:
image = ChunkyPNG::Canvas.from_data_url(params[:data]).to_image
(The docs for this method are available here)
It results in the following error:
NameError in MyController#create
uninitialized constant MyController::ChunkyPNG
Why is prepending the controller namespace? I imagine that's what is causing the error.
Otherwise, it means that ChunkyPNG is not install (and it clearly is).
Am I not able to use this gem upfront without writing some sort of rails plugin to wrap around it?
Thanks
EDIT:
Question has been answered, see #apneadiving's comment
In your controller, or somewhere else in the app do:
require 'chunky_png'
I'm having this strange error for the devise_invitable extension:
uninitialized constant ActiveSupport::SecureRandom
But the strange thing is that I don't know how to load that module anyway, like if in my console I execute ActiveSupport, thats fine and responds with true but not that SecureRandom class, or ActiveSupport::SecureRandom, and like I know its part of ActiveRecord, it's in the docs here: http://api.rubyonrails.org/classes/ActiveSupport/SecureRandom.html
How would you start troubleshooting an issue like this?
More Details
So it seems the class SecureRandom works as is, but not when called as part of ActiveSupport like ActiveSupport::SecureRandom, why would this be?
I fixed this by switching to the master branch of Devise on my 3-1-stable Rails application.
gem 'devise', :git => "git://github.com/plataformatec/devise"
I ran into this issue with the activeadmin gem and solved it with a hack at the top of devise.rb
ActiveSupport::SecureRandom = SecureRandom
Source: http://coderwall.com/p/fttpra