I have both a local dev install of Enki on OS X, and a deployed Enki
blog on Ubuntu 8.04, both running Ruby 1.9.2dev and Rails 2.3.2. I
wanted to identify a couple of issues I've had getting things working,
and ask a question in hopes of getting some help.
Problems I ran into, and how I fixed them:
1. The gem name for latest mislav-will_paginate (2.3.11) is
inconsistent between OS X and Ubuntu, using identical RubyGems
(1.3.5), on OS X it is will_paginate but on Ubuntu it is mislav-
will_paginate. I couldn't figure out a way to reconcile these
differences to I commented out line 13 in config.rb, since the
config.gem name was different on each platform.
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):
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] %>
3. On Ubuntu, for some reason, I got the following error when trying
to log into the admin:
OpenSSL::SSL::SSLError (hostname was not match with the server
certificate)
No idea why I started getting this, but I fixed this by issuing the
following command:
UPDATE: I resolved #1 in a better way by uninstalling my local
"will_paginate" gem and reinstalling "mislav-will_paginate".
Apparently, even though the version was correct (2.3.11) that is being
obsoleted. The github mislav-will_paginate wiki has the following:
The name of the will_paginate gem is now “mislav-will_paginate”
because it’s being built by GitHub. If you have a gem named
“will_paginate”, it is old and you are advised to remove it from your
system.
This fixed another issue I was having in the admin (on local dev)
where paginating content was broken (presumably because I had
commented this out). In case you haven't noticed, I'm still learning
my way around the ruby world.
On Oct 25, 9:15 am, Dylansm <foliome...@gmail.com> wrote:
> I have both a local dev install of Enki on OS X, and a deployed Enki
> blog on Ubuntu 8.04, both running Ruby 1.9.2dev and Rails 2.3.2. I
> wanted to identify a couple of issues I've had getting things working,
> and ask a question in hopes of getting some help.
> Problems I ran into, and how I fixed them:
> 1. The gem name for latest mislav-will_paginate (2.3.11) is
> inconsistent between OS X and Ubuntu, using identical RubyGems
> (1.3.5), on OS X it is will_paginate but on Ubuntu it is mislav-
> will_paginate. I couldn't figure out a way to reconcile these
> differences to I commented out line 13 in config.rb, since the
> config.gem name was different on each platform.
> 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):
> 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] %>
> 3. On Ubuntu, for some reason, I got the following error when trying
> to log into the admin:
> OpenSSL::SSL::SSLError (hostname was not match with the server
> certificate)
> No idea why I started getting this, but I fixed this by issuing the
> following command:
I get two failures running 'rake' against 1.9, do you get the same? 1) 'Admin::HealthController handling POST to exception when logged in raises a RuntimeError' FAILED expected Exception but nothing was raised /Users/xavier/Code/enki/spec/controllers/admin/health_controller_spec.rb:23 :in `block (4 levels) in <top (required)>'
2) 'Admin::SessionsController#allow_login_bypass? when RAILS_ENV == production returns false' FAILED expected: false, got: true (using ==) /Users/xavier/Code/enki/spec/controllers/admin/sessions_controller_spec.rb: 44:in `block (3 levels) in <top (required)>'
I will investigate the config failures, see if I can reproduce
On 26/10/09 10:56 AM, dylansm wrote:
> UPDATE: I resolved #1 in a better way by uninstalling my local > "will_paginate" gem and reinstalling "mislav-will_paginate". > Apparently, even though the version was correct (2.3.11) that is being > obsoleted. The github mislav-will_paginate wiki has the following:
> The name of the will_paginate gem is now “mislav-will_paginate” > because it’s being built by GitHub. If you have a gem named > “will_paginate”, it is old and you are advised to remove it from your > system.
However I think this is now wrong again since github stopped building gems. I have pushed a commit to use non-github gems.
On Oct 26, 11:02 pm, Xavier Shay <xavier-l...@rhnh.net> wrote:
> 2)
> 'Admin::SessionsController#allow_login_bypass? when RAILS_ENV ==
> production returns false' FAILED
> expected: false,
> got: true (using ==)
> /Users/xavier/Code/enki/spec/controllers/admin/sessions_controller_spec.rb: 44:in
> `block (3 levels) in <top (required)>'
I replaced all RAILS_ENV with ::RAILS_ENV in
sessions_controller_spec.rb to take care of this spec test failure.
Not sure if that's the right solution, but new scoping rule with Ruby
1.9 seem to cause this issue.
> On Oct 26, 11:02 pm, Xavier Shay<xavier-l...@rhnh.net> wrote:
>> 2)
>> 'Admin::SessionsController#allow_login_bypass? when RAILS_ENV ==
>> production returns false' FAILED
>> expected: false,
>> got: true (using ==)
>> /Users/xavier/Code/enki/spec/controllers/admin/sessions_controller_spec.rb: 44:in
>> `block (3 levels) in<top (required)>'
> I replaced all RAILS_ENV with ::RAILS_ENV in
> sessions_controller_spec.rb to take care of this spec test failure.
> Not sure if that's the right solution, but new scoping rule with Ruby
> 1.9 seem to cause this issue.
ah spot on, I just committed a different fix which was much worse than this, so I will amend
> 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):
> 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] %>
> > 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):
> > This always produced the following error: ArgumentError: wrong number
> > of arguments(2 for 1). So I had to change exception_notifier.rb to
> > this:
> > 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] %>
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:
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):
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.
> 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):