I'm Getting An Uninitialized Constant Error From A Recently Installed Gem. How do you fix this? - ruby-on-rails

I recently installed the Citier Gem. Its Gem a solution for simple Multiple Class Inheritance in Rails. After setting up models per the instructions and running Rake, I am getting the following error:
uninitialized constant Books::Writable
*/citier/core.ext.rb:33:in 'create_citier_view'
Its been my experience that this error message usually means the Gem is not installed properly, but I've checked my Gemfile and did a Bundler Show command and everything seems to be in order. Apparently, the core.ext file referenced in the error is supposed to be extending ActiveRecord to create views that are utilized for Multiple Class Inheritance.
I checked all the usual places for the problem but can't seem to figure this out. In suggestions or ideas would be greatly appreciated. I've been stuck on this one for a couple of days now.
Thanks for you input.

Simply type require 'rails_sql_views' in config/application.rb
U may need install gem rails_sql_views

Related

Controller not recognizing installed Gem

Okay, I know this is a bit of a simple question, but I can't seem to get it to work. I have installed the SmarterCSV gem in my Rails 4 app and am trying to use it in my controller like so:
SmarterCSV.process("/files/csv_file.csv")
I can do this exact process in the rails console for this app, but I cannot seem to get it to work in my controller. Every time I just get the Rails Dead Screen saying uninitialized constant MyController::SmarterCSV. I have tried adding the line
require 'smarter_csv'
But that also breaks to the Rails Dead Screen with the error cannot load such file -- smarter_csv
Any help would be greatly appreciated, Im not entirely sure what I can do...
you can try require 'smarter_csv/smarter_csv' as this is the path of the file in the gem https://github.com/tilo/smarter_csv/blob/master/lib/smarter_csv/smarter_csv.rb
Don't forget to restart your application after bundle install

Security Update for Spree Finding Nil for Money:Class

This security update for spree just released, but after running some Cucumber tests, I had this recurring issue:
undefined method `assume_from_symbol' for Money:Class (ActionView::Template::Error)
I searched the project repo on GH and we don't use the method. Searched the Money repo and also no findings. Searched Spree and found this. The method appears to be undefined on my development environment.
I don't know if its Spree or the project I'm dealing with. Does anyone know how to fix this?
Update: When I run bundle exec zeus cucumber I don't get these errors...
Just had this issue, followed the advice in: https://github.com/spree/spree/issues/4517
IE: add this to your Gemfile
gem 'money', '6.0.1'
fixed my issue.
I believe this is a bug in Spree:
https://github.com/spree/spree/issues/4517
You should specify the following in your Gemfile:
gem 'money', '=6.0.1'
to work around the issue for now.
Answer provided by John worked for me. However, I also had to edit the Gemfile with TextMate (or your own text editor) to make sure the single quotes are correct, as explained in this post: Gem syntax error questions

How to actually use rails-settings?

I'm trying to use rails-settings gem but i'm not sure how to do that.
I've added ledermann-rails-gem gem to Gemfile, runned bundle install, generated a migration based on what's written in wiki, runned rake db:migrate, restarted a server and now, when i'm trying to do anything from rails-settings wiki, i'm getting an error.
Let's say i want to create new variable so i'm putting this code to my controller:
Settings.foo = "bar"
It gives me the following error:
uninitialized constant ApplicationController::Settings
I'm quite 'fresh' in rails development and probably there is some small thing which wasn't mentioned in the wiki because it's obvious (but not for me!). Any help would be appreciated

NameError occurs after switching from vendored gems to Bundler in Rails 2.3.8

/Users/me/.rvm/gems/ree-1.8.7-2011.03#evokat25/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:105:in `const_missing':NameError: uninitialized constant Rails::Initializer::Paperclip
There is no mention of Rails::Initializer::Paperclip anywhere in my code base. Anybody have a clue as to what it is trying to do?
I figured this out. I had some configuration lines in config/initializers/.rb and config/environments/.rb. After I put the "require" lines in each for the appropriate gems, the problem disappeared.

Rails 2.3.8 tiny mce issue - undefined method `uses_tiny_mce'

I am facing an issue in my application with tiny mce.
All the gem version & ruby version is OK on my system, but it is giving me error
= undefined method `uses_tiny_mce'
Here i installed the tiny_mce gem. COnfigured it correctely, but still there is an issue.
Please help.
Did you include
config.gem 'tiny_mce'
in config/environment.rb?
I have used this gem in the past too, but have stopped using it. I figured it complicated the setup and deployment of my Rails apps. Since then I have just used the TinyMCE editor by itself. Since it is 100% javascript, it does not touch any Ruby code which keeps things better organized.
I was not using this as a plugin.
I have followed the steps given in the,
http://enginey.googlecode.com/svn/trunk/vendor/plugins/tiny_mce/README.rdoc
Steps :
script/plugin install git://github.com/kete/tiny_mce.git
rake tiny_mce:install
my issue got resolved.

Resources