Closed GoogleCodeExporter closed 9 years ago
I'm having a hard time reproducing your problem. I tried it on a fresh XP
machine and
it worked fine. Here's what I did:
1. Installed the latest version of Rails: `gem install -y rails`
2. Created a fresh Rails application: `rails my_test`
3. Configured the database for the my_test app.
4. Generated a test controller: `ruby script\generate controller test`
5. Installed the RubyCAS-Client plugin: `ruby script/plugin install
http://rubycas-client.googlecode.com/svn/trunk/rubycas-client`
6. Configured the CAS client in config\environment.rb.
7. Added the filter to the Test controller: "before_filter
CASClient::Frameworks::Rails::Filter"
Now when I try to visit http://localhost:3000/test it works fine, redirecting
me to
the CAS login page.
Can you repeat the steps above and let me know if you're still having problems?
Original comment by matt.zuk...@gmail.com
on 21 Feb 2008 at 8:15
Reading over your bug report, it sounds like something may be wrong with the
way the
plugin is getting installed. Can you be a bit more specific about what hapens
when
you run:
ruby script/plugin install
http://rubycas-client.googlecode.com/svn/trunk/rubycas-client
Also you mention that it is not a "working copy". If you're looking to check
out a
subversion repo then you need to use the -x flag with your plugin install:
ruby script/plugin install -x
http://rubycas-client.googlecode.com/svn/trunk/rubycas-client
If all else fails, you can try installing the client as a rubygem:
gem install rubycas-client
If you install as a gem, make sure you add "require 'rubycas-client'" to your
environment.rb file.
Original comment by matt.zuk...@gmail.com
on 21 Feb 2008 at 8:32
Matt,
Thank you very much for quick response.
I just followed your steps 1 to 7 and now CAS plug in installed successfully. I
don't see "not a working copy" error any more.
but still getting "`load_missing_constant': uninitialized constant CASClient
(NameError)".
Here I am my configurations:
config/environment.rb
===================
# Be sure to restart your server when you modify this file
# Uncomment below to force Rails into production mode when
# you don't control web/app server and can't set it the proper way
# ENV['RAILS_ENV'] ||= 'production'
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
Rails::Initializer.run do |config|
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# See Rails::Configuration for more options.
CASClient::Frameworks::Rails::Filter.configure(
:cas_base_url => "https://cas.example.foo/"
)
# Skip frameworks you're not going to use (only works if using vendor/rails).
# To use Rails without a database, you must remove the Active Record framework
# config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
# Only load the plugins named here, in the order given. By default, all plugins
# in vendor/plugins are loaded in alphabetical order.
# :all can be used as a placeholder for all plugins not explicitly named
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Add additional load paths for your own custom dirs
# config.load_paths += %W( #{RAILS_ROOT}/extras )
# Force all environments to use the same logger level
# (by default production uses :info, the others :debug)
# config.log_level = :debug
# Your secret key for verifying cookie session data integrity.
# If you change this key, all old sessions will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
config.action_controller.session = {
:session_key => '_HelloProjects_session',
:secret
=>
'b96668e0b0bc1db4d515650600d0dfadf284cb111477add9ff61b79c5dae007c664f444576b16f4
06
5b2d3b7ee0fc0bae0d2723c60834b681a157ce42312f4b5'
}
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with 'rake db:sessions:create')
# config.action_controller.session_store = :active_record_store
# Use SQL instead of Active Record's schema dumper when creating the test database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql
# Activate observers that should always be running
# config.active_record.observers = :cacher, :garbage_collector
# Make Active Record use UTC-base instead of local time
# config.active_record.default_timezone = :utc
end
======================================
app/test_controller.rb
class TestController < ApplicationController
before_filter CASClient::Frameworks::Rails::Filter
end
any help is greatly appreciated.
Original comment by sgod...@gmail.com
on 21 Feb 2008 at 9:20
Ahh! Put your CASClient configuration AFTER the Rails::Initializer stuff --
i.e. at
the very bottom of your environment.rb file.
The Rails Initializer is for configuring only Rails itself. You should never
put code
in there that concerns third-party libraries like RubyCAS.
I think once you do this you should find that it works fine.
Original comment by matt.zuk...@gmail.com
on 27 Feb 2008 at 8:07
Excellent. I have it working now. Thank you very much for your support. :)
Original comment by sgod...@gmail.com
on 4 Mar 2008 at 6:52
Original issue reported on code.google.com by
sgod...@gmail.com
on 20 Feb 2008 at 11:34