Typus and Rails 3.1 - missing constant AdminsController - ruby-on-rails

Gemfile:
gem 'rails', '3.1.0.rc4'
gem 'typus', :git => 'http://github.com/typus/typus', :branch => '3-1-unstable'
Obviously the name of the Git-branch suggests that it's error prone, but I think I might be missing something simple here. According to the documentation rails g typus and rails g typus:migration should be enough to get going.
My problem is that I'm missing the AdminsController, after migrating and navigating to 0.0.0.0:3000 I get greeted by
uninitialized constant AdminsController
and there is no AdminsController.rb in app/controllers. Is this a bug in the 3.1 branch or am I missing something in the documentation?

Teddy bear theory strikes again. Navigating to /admin/session/ greets me with a login page. I get the feeling that navigating to /admin/ should still produce some output and not an error message though.

Looking at the commits it's so bleeding edge that's probably a bug.
I see that you already notified developers by opening a ticket, hopefully they'll look into it soon.
Happens to me also all the time with stuff that is trying to be 3.1 compatible, for which I create a patch when it's possible.
Cheers

Turns out the problem was entirely my fault. I didn't have a clean admin namespace like I should have.

Related

Issue adding Bootstrap on Ruby on Rails Project

This is what I followed in order to get started with bootstrap on Ruby on Rails.
I followed every step exactly the same. However, I keep running into the same error for some reason. When I do not do any thing (i.e. do not use bootstrap) everything works (but the application looks trashy).
Whenever I use bootstrap, I get:
invalid regexp character
This is the application trace:
(execjs):24299
app/views/layouts/application.html.erb:8:in `_app_views_layouts_application_html_erb__337612969_59863020'
I have no clue what is happening.
P.S. I am a beginner. So if the solution is simple then, yeah...
remove #gem 'duktape' from gem file..the issue will be solved

Paperclip aws-sdk error: uninitialized constant

I'm currently running into the uninitialized constant Paperclip::Storage::S3::AWS error when I attempt to upload files to my server. I understand this to be typically caused by running an older version of paperclip, before they added support for aws-sdk-v2. The strange thing is that I'm running the latest paperclip version (4.3.1) which, according to its github page, includes aws-sdk-v2 support.
Honestly, I'm not sure what more I can say about this. I checked the error log and the above is the only complaint it has. Do I need to do anything special to run v2 with paperclip? Thanks to anyone who can shine any light onto this matter.
the issue is written here:
http://ruby.awsblog.com/post/TxFKSK2QJE6RPZ/Upcoming-Stable-Release-of-AWS-SDK-for-Ruby-Version-2
try to change your Gemfile to:
gem 'aws-sdk', '< 2.0'
Figured it out with the help of some folks over at github. (See the thread here.)
Basically it seems that paperclip 4.3.1 doesn't entirely support v2 yet. A week after it was released or so, a commit was pushed to the master that gets past this error. It appears not to be perfect but here's how I made it work.
You can specify this particular revision of paperclip to bundler with the following line:
gem 'paperclip', :git=> 'https://github.com/thoughtbot/paperclip', :ref => '523bd46c768226893f23889079a7aa9c73b57d68'
More information on this sort of thing can be found here.
You will need to specify the REGION of your in your paperclip defaults. This can be done by dropping a :s3_region=> 'us-west-2' (or whatever your region is) into your paperclip_defaults. Simply specifying the endpoint or host will not be enough. You can look yours up here.
Also slightly confusing is the error message if the above isn't done properly:
missing region; use :region option or export region name to ENV['AWS_REGION']
I couldn't get the recommended environment variable to work.
The :region option is somewhat misleading as it needs to be written :s3_region

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

Installing and using acts-as-taggable-on

This is going to be a really dumb question, I just know it, but I'm going to ask anyways because it's driving me crazy.
How do I get acts-as-taggable-on to work?
I installed it as a gem with gem install acts-as-taggable-on because I can't ever seem to get installing plugins to work, but that's a whole other batch of questions that are all probably really dumb. Anyways, no problems there, it installed correctly.
I did ruby script/generate acts_as_taggable_on_migration and rake db:migrate, again no problems.
I added acts_as_taggable to the model I want to use tags with, started up the server and then loaded the index for the model just to see if what I've got so far is working and got the following error: undefined local variable or method `acts_as_taggable' for #.
I figure that just means I need to do something like require 'acts-as-taggable-on' to my model's file because that's typically what's necessary for gems. So I did that hit refresh and got uninitialized constant ActiveRecord::VERSION. I'm not even going to pretend to begin to know what that means went wrong.
Did I go wrong somewhere or there something else I need to do. The installation instructions seem to me like they just assume you generally know what you're doing and don't even begin to explain what to do when things go wrong.
Did you try to define your gem dependencies in config/environment.rb (Rails 2.3):
Rails::Initializer.run do |config|
#...
config.gem 'acts-as-taggable-on'
#...
end
Or in Gemfile for Rails 3 or if you use already Bundler with rails 2.3:
gem 'acts-as-taggable-on'
This should make the require 'acts-as-taggable-on' unnecessary
Maybe following the installation here can help.
For example you don't need to:
require 'acts-as-taggable-on'
but:
class User < ActiveRecord::Base
acts_as_taggable
end
Otherwise you need to post more details about the error.
I installed acts-as-taggable-on for my app through github. If you want to try that method instead of the gem, you can read my this post that explains my experience: http://blog.mediummassage.com/2010/04/27/creating-categories-in-the-store-with-tags/

Resources