integrating CAS authentication on Rails 3 - ruby-on-rails-3

I have integrated RubyCAS-Client from this github https://github.com/rubycas/rubycas-client It is working and bring up my CAS server for authentication... But the problem that I have is after inserting before_filter CASClient::Frameworks::Rails::Filter on my application_controller.rb, my model is not working and I could not add/edit/delete things from my model.
My Rails version is 3.2.6 and ruby version is 1.8.7.
Any help for this problem?

Under "Installation" on the readme for rubycas/rubycas-client it says this:
NOTE: For compatibility with Rails 3 have a look at
http://github.com/zuk/rubycas-client-rails
Edit: That project has been moved to http://github.com/rubycas/rubycas-client-rails

Related

Newrelic rpm does not work with Rails 5 + Rocketpant

I recently upgrade my Rails app from 4.2.5 to 5.0.2
Everything works fine except Newrelic RPM to track our API performance.
On Rails 4.2.5, we are using a folk of the gem 'rocket_pants-rpm' to make Newrelic track Rocketpants API endpoint correctly.
https://github.com/Sutto/rocket_pants-rpm/pull/3/files
But after upgrading to 5.0.2, this fork does not work anymore.
I am not very familiar with how the Newrelic agent works, any idea to make Newrelic work with Rails 5 + Rocketpants again?
I fix the issue myself. It turns out the gem rocket_pants-rpm doesn't load Newrelic agent since it does NOT check Rails major version 5.
I have submitted a pull request
https://github.com/Sutto/rocket_pants-rpm/pull/4
Which solves this issue, now Newrelic shows my API endpoints under namespace Api::V1 again : )

Why are development style sheets and devise logout not working?

I have a 3.2.8 Rails application which has been deployed into production and is running just fine. While preparing to code an enhancement I pulled fresh code from the SVN and started up a development version of the application and found the stylesheets were non functional and the Devise logout did not work in DEVELOPMENT.
All other aspects of the application work exactly as they should.
I've been reading many stack over flow Q & A and cannot figure this out.
Then I realized the default version of Ruby did not match the version for the application.
The application was built with ruby 1.9.3 p286 and my machine boots up in Ruby 2.1.0
solution:
stop the server
rvm use ruby-1.9.3-p286
bundle install
rails server
= good to go.

Rails: Installing Twitter-Bootstrap 3 in a Rails project

I am a total n00b and am trying to install Twitter-Bootstrap 3 into my rails project. The twitter-bootstrap-rails gem is unfortunately only for version 2.0, otherwise I would totally use that. Is there some kind of set up magic I need to do in my app to configure it with my Rails project other than copy and paste the Bootstrap directories into my rails project repo?
Any and all advice much appreciated!

wrong number of arguments (3 for 1) after upgrading rails from 3.1.1 to 3.1.3

I have upgraded my rails 3.1.1 application to rails 3.1.3, and now, on every request, it answers only wrong number of arguments (3 for 1). Unfortunately, it doesn't says where the error was, and application trace is empty. I think there's some compatibility problem, but I really don't know where to dig.
There are my Gemfile and a framework trace: https://gist.github.com/1519479
Thanks for any help.
Run bundle show and check version of omniauth gem. May be while upgrading rails you updated omniauth as well.
Version 1.* of omniauth requires separate gem omniauth-twitter for twitter authentication. As you don't have it in your Gemfile it tries to load as middleware Twitter class from twitter gem that would cause similar error.
To avoid issues like that in the future consider using "~> 0.2.6" for gems versioning instead of ">= 0.2.6". It protects you from unexpected major releases of gems you're using.

How to use rspec_scaffold generator with latest rspec gem

I am a newbie to Rails 3 and Rspec. Kindly excuse my being a novice.
I am trying to use RSpec with Rails 3. I am using rails 3.0.3 and ruby 1.9.2 on ubuntu 10.04 os.
I am currently referring to the tutorial on :- http://www.railsfire.com/article/rspec-behaviour-driven-development-testing-framework. This tutorial not only uses old plugins , but old Rails version of 2.x also.
I am unable to use the old rspec generator ( rspec_scaffold ) with rspec 2.5 and rspec-rails 2.5 gem. As expected I get the following error as given below.
mohnish#mohnish-desktop:~/rails_testing/10Mar11/rspec_demo3$ rails g rspec_scaffold post title:string body:text
Could not find generator rspec_scaffold.
mohnish#mohnish-desktop:~/rails_testing/10Mar11/rspec_demo3$
Could you please tell me how should I give to accordingly for it to work for me using the above RoR configuration.
Thanks
The latest Rspec gems don't require the old generator mentioned above, basically on giving rails g in your rails app you would get all the list of generators with your app.
Thus, once you have installed the Rspec related gems, then give a rails g to your app, you need to basically run only one of the generator command from the modified list that you would get, which is rspec:install and this would be enough to get you up & running at least with a proof of concept(poc).