On Oct 27, 7:03 pm, Xavier Shay <xavier-l...@rhnh.net> wrote:
> On 26/10/09 3:15 AM, Dylansm wrote:
> > 2. Problems parsing Enki.yml file. I couldn't access config settings
> > for values under author, such as email or name, by doing this (from
> > Config/Initializers/exception_notifier.rb):
> > ExceptionNotifier.exception_recipients = [Enki::Config.default
> > [:author, :email]]
> > This always produced the following error: ArgumentError: wrong number
> > of arguments(2 for 1). So I had to change exception_notifier.rb to
> > this:
> > ExceptionNotifier.exception_recipients = [Enki::Config.default
> > [:author][:email]]
> > This is, of course, because of the "symbolize_keys" method—in irb it
> > would be: default["author"]["email"]. Along the same line, I had to
> > change line 48 in application.html.erb (footer) to access author name
> > this way:<%=h config[:author][:name] %>
> $ irb
> irb(main):001:0> RUBY_VERSION
> => "1.9.1"
> irb(main):002:0> require 'config/environment'
> => true
> irb(main):003:0> Enki::Config.default[:author, :email]
> => "d...@enkiblog.com"
> ^ please run on your environment
Here's the output for this:
>> RUBY_VERSION
=> "1.9.2"
>> require 'config/environment'
NameError: uninitialized constant Enki::SimpleDelegator
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:440:in `rescue in
load_missing_constant'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:436:in `load_missing_constant'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:80:in `const_missing_with_dependencies'
from /Users/Shared/Development/_rails_apps/foliomedia_enki/lib/enki/
config.rb:2:in `<module:Enki>'
from /Users/Shared/Development/_rails_apps/foliomedia_enki/lib/enki/
config.rb:1:in `<top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:380:in `load'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:380:in `block in load_file'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:521:in `new_constants_in'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:379:in `load_file'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:259:in `require_or_load'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:425:in `load_missing_constant'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:80:in `const_missing_with_dependencies'
from /Users/Shared/Development/_rails_apps/foliomedia_enki/config/
initializers/exception_notifier.rb:1:in `<top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:145:in `load'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:145:in `block in
load_with_new_constant_marking'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:521:in `new_constants_in'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:145:in `load_with_new_constant_marking'
from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/
initializer.rb:600:in `block in load_application_initializers'
from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/
initializer.rb:599:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/
initializer.rb:599:in `load_application_initializers'
from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/
initializer.rb:174:in `process'
from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/
initializer.rb:113:in `run'
from /Users/Shared/Development/_rails_apps/foliomedia_enki/config/
environment.rb:9:in `<top (required)>'
from (irb):2:in `require'
from (irb):2
from /usr/local/bin/irb:12:in `<main>'
> > 4. Still can't access admin using OpenID. The error I'm getting is:
> > NoMethodError (undefined method `author_open_ids' for #<Enki::Config:
> > 0x00000002d92a90>):
> > app/controllers/admin/sessions_controller.rb:19:in `block in create'
> > app/controllers/admin/sessions_controller.rb:17:in `create'
> hmm
I can't seem to get the author_open_ids method to be seen. I think
Enki::Config is not initialized or is not what it should be at the
time this is called. I can hard code the openid url, like this
(sessions_controller, line 19):
if [URI.parse("http://myopenid.blah")].include?(URI.parse
(identity_url))
and it works, at least until I get to the admin/dashboard/show
template where line 8 causes an error (because config is again not
visible or something):
<h1><%-#= link_to(h(config[:title]), '/') %></h1>
So, commenting it out has been my workaround, for now.
> $ md5 lib/enki/config.rb
> MD5 (lib/enki/config.rb) = 1d75053e36ca36ba1370f1216e624c03
md5 lib/enki/config.rb
MD5 (lib/enki/config.rb) = 34105bea008c05a82fd278894da543cc
> when did you clone enki? You've got a recent HEAD? Please post the top
> of your git log.
I'm sorry, I don't know the exact date when I cloned it. Here's the
top of the git repos log I have (I may be working with source that's
older, but most of the code I've compared looks to be the same):
commit 26ac45833d4ece2f637a9d6d8a99791004b8f1b9
Author: Xavier Shay <xav...@rhnh.net>
Date: Fri Jul 31 16:38:10 2009 +1000
Thanks for looking into this.
> > Any ideas? I would greatly appreciate input on any of this.