Problems with upgrade

Upgrading Typo with the instructions at
http://typosphere.org/wiki/typo/Upgrade_Typo_with_Typo_installer
and a ~/gems repository fails.

Some stuff can deal with but this one defeats me.

This is the error I get


Checking database
Database exists, preparing for upgrade
expanding apache13.conf.example template
expanding apache20.conf.example template
expanding lighttpd.conf.example template
Migrating Typo’s database to newest release
/home/antonaylward/gems/gems/typo-5.1.2/bin/typo:59:in migrate': Migration failed (RailsInstaller::InstallFailed) from /home/antonaylward/gems/gems/rails-app-installer-0.2.0/lib/rails-installer.rb:689:in in_directory’
from /home/antonaylward/gems/gems/typo-5.1.2/bin/typo:57:in
migrate' from /home/antonaylward/gems/gems/rails-app-installer-0.2.0/lib/rails-installer.rb:217:in install_sequence’
from
/home/antonaylward/gems/gems/rails-app-installer-0.2.0/lib/rails-installer.rb:192:in
install' from /home/antonaylward/gems/gems/rails-app-installer-0.2.0/lib/rails-installer/commands.rb:95:in command’
from
/home/antonaylward/gems/gems/rails-app-installer-0.2.0/lib/rails-installer.rb:646:in
execute_command' from /home/antonaylward/gems/gems/typo-5.1.2/bin/typo:93 from /home/antonaylward/gems/bin/typo:19:in load’
from /home/antonaylward/gems/bin/typo:19

A manual “rake db:migrate” completes OK.


There are two ways to slide easily through life: to believe
everything or to doubt everything; both ways save us from
thinking. – Alfred Korzybski

Anton J Aylward said the following on 29/07/08 10:42 AM:

A manual “rake db:migrate” completes OK.

But it doesn’t like my theme!
(dual sidebar –
http://blog.emarm.com/articles/2006/08/09/multiple-sidebars-in-typo)

I thought that if I logged in as admin I could change the theme, but I
get a 500 on that.

NoMethodError (undefined method current_user=' for #<AccountsController:0x42659c84>): /app/controllers/accounts_controller.rb:8:in login’


It is an error to imagine that evolution signifies a constant tendency
to increased perfection. That process undoubtedly involves a constant
remodelling of the organism in adaptation to new conditions; but it
depends on the nature of those conditions whether the directions of the
modifications effected shall be upward or downward.
Thomas H. Huxley

Anton J Aylward said the following on 29/07/08 01:01 PM:

NoMethodError (undefined method current_user=' for #<AccountsController:0x42659c84>): /app/controllers/accounts_controller.rb:8:inlogin’

I’ve tried doing a clean install of a new ‘site’ rather than an upgrade
and I still get this error.

Am I supposed to have some other gem or plugin installed to deal with
the ID/authentication?

I also get

ActionView::TemplateError (Couldn’t find template file for
/sidebars/sidebar/_content in ["~/typo5/themes/typographic/views",
“/~typo5/app/views”]) on
line #27 of themes/typographic/layouts/default.html.erb:
24: <%= render :partial => ‘shared/search’ %>
25:
26:
27: <%= render_sidebars %>
28:
29:
30:

Which I find difficult to understand.
I though ‘typographic’ was the default layout and so would be fully
supplied. Alternatively I don’t understand why the engine isn’t looking
and finding ~/typo5/app/view/sidebars

Perhaps because its ‘sidebar’ rather than than ‘sidebars’?

$ ls typo5/app/views/
accounts/ articles/ layouts/ notification_mailer/ shared/ theme/
admin/ comments/ live/ settings/ sidebar/ xml/
$ ls typo5/app/views/sidebar/
_row.html.erb _sidebar.html.erb display_plugins.html.erb
show.html.erb

No, we need an extra level in there.

How come this happens to me? How come I haven’t seen mention of this in
the bug reports?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Anton,

Anton A. wrote:

So, in an effort to compare the upgrade with a virgin install, I’m
trying to install typo on my laptop.

What OS are you running on your laptop. I’m guessing Linux? Which
distribution?

I start with

$ sudo gem install typo

and I get

[…]
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

What are those details in mkmf.log?

Oh!
Well I do have /usr/lib/mysqlclient …

rpm -q -f /usr/lib/libmysqlclient.so

libmysql15-5.0.45-8.2mdv2008.0
Now it happens that is sripped. I don’t know why.

Ah, an rpm based distro. Probably you need to install the -dev package
for libmysql as well.

Hmm. So I try

[anton@laptop Ruby]$ find /usr/lib/ruby /home/anton
-name ‘rails-installer*’ -print

which returns nothing.

The typo gem requires ‘rails-app-installer’, I’m guessing you need to
install that gem.

Regards,
Matijs.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iD8DBQFIl6T2h3TgaXYDPEERAuV6AKCQ2dRVJXUBsnJZ96HaNDIZCeeulwCePw90
qZL/rCDCYydwscgrP28twCE=
=opYv
-----END PGP SIGNATURE-----

So, in an effort to compare the upgrade with a virgin install, I’m
trying to install typo on my laptop.

I start with

$ sudo gem install typo

and I get

Password:
Building native extensions. This could take a while…
ERROR: Error installing typo:
ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb install typo
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lm… yes
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lz… yes
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lsocket… no
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lnsl… yes
checking for mysql_query() in -lmysqlclient… no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Oh!
Well I do have /usr/lib/mysqlclient …

rpm -q -f /usr/lib/libmysqlclient.so

libmysql15-5.0.45-8.2mdv2008.0
Now it happens that is sripped. I don’t know why.

So I gave up o that and tried installing from the .tgz
I unpacked ok, and then

[anton@laptop Ruby]$ ./typo-5.1.2/bin/typo install
typo-5.1.2/db/emerge
database=sqlite3

/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require': no such file to load -- rails-installer (LoadError) from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:inrequire’
from ./typo-5.1.2/bin/typo:4

Hmm. So I try

[anton@laptop Ruby]$ find /usr/lib/ruby /home/anton
-name ‘rails-installer*’ -print

which returns nothing.

Yes, I did a ‘sudo gem update’ before this.

Matijs van Zuijlen said the following on 04/08/08 08:55 PM:

Hi Anton,

Hi, and thanks. No, realy, I’m grateful someone finally replied. I was
getting frustrated. (Still am actually!)

This was my 4th or fifth post about problems with this version of Typo.
I’d tried upgrading my site first - MISTAKE! - and have a number of
posts about that. Perhaps you’d care to look back over them and comment
on that content as the experience was a bit different from this attempt
to install Typo on my laptop

Anton A. wrote:

So, in an effort to compare the upgrade with a virgin install, I’m
trying to install typo on my laptop.

What OS are you running on your laptop. I’m guessing Linux? Which
distribution?

Mandriva 2008.0

What are those details in mkmf.log?

See later

Oh!
Well I do have /usr/lib/mysqlclient …

rpm -q -f /usr/lib/libmysqlclient.so

libmysql15-5.0.45-8.2mdv2008.0
Now it happens that is sripped. I don’t know why.

Ah, an rpm based distro. Probably you need to install the -dev package
for libmysql as well.

I really don’t like this.
Why should I have to install an application development package just to
install Typo? Will I have to install a compiler and possibly YACC/LEX
as well.

Please guys, this is a bit of a heavy load.

So I load up gcc etc and it turns out that the error in the log file is

conftest.c: In function ‘t’:
conftest.c:3: error: ‘mysql_query’ undeclared (first use in this
function)

Is this set of dependencies (on the compiler etc) declared anywhere?
Why do I have to go though this if I only want to use Typo with sqlite3

Hmm. So I try

[anton@laptop Ruby]$ find /usr/lib/ruby /home/anton
-name ‘rails-installer*’ -print

which returns nothing.

The typo gem requires ‘rails-app-installer’, I’m guessing you need to
install that gem.

Is that dependency declared anywhere?

Oh, right, let me guess, if I’d installed with the GEM it would have
dragged that dependency in.

HA-BLOODY-HA-HA

My “other” blog is Wordpress & I didn’t have this problem upgrading
that.

Originally preferred Typo to Wordpress, now I’m having my doubts.
I’m really disappointed in this “upgrade”. When I started using Typo
two years ago (26/08/06 08:54 PM) I had none of these problems, neither
on my laptop nor on Dreamhost (once they got Ruby 1.8.4 up). It was the
slickness and ease of installation & configuration that impressed me
back them.

PostScript:

I just installed ‘libmysql-devel’ using urpmi, the normal and
recommended method, and ‘gem install typo’ still fails.

I seriously think you need to reconsider what it takes for an ordinary
non-development user to install Typo.

Regards,
Matijs.

You can either take action, or you can hang back and hope for a miracle.
Miracles are great, but they are so unpredictable.
–Peter F. Drucker

Le 5 août 08 à 14:03, Anton J Aylward a écrit :

posts about that. Perhaps you’d care to look back over them and

distribution?

details. You may need configuration options.
package
So I load up gcc etc and it turns out that the error in the log file
Why do I have to go though this if I only want to use Typo with
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in

two years ago (26/08/06 08:54 PM) I had none of these problems,
I just installed ‘libmysql-devel’ using urpmi, the normal and

Regards,
Matijs.

Hello,

first, sorry for not replying faster, I was in holliday and got
internet access only tonight. Trying to answer the pile of mails
that’s waiting for me.

This is not a Typo but rails issue: to use a Rails application, you
need a database driver, ie ruby mysql driver. That’s the reason why
you needed so much dependencies. In an ideal world, your distro would
embed a package named ruby-mysql with the proper driver, or anything
else. The problem is Rails gem has its own dependencies system which
differs from RPM and you won’t register Typo MySQL gem with rpm and
the contrary.

I’ve actually tried to reduce the number of dependencies in the last
releases, removing some of them as much as I could.

Cheers,
Frédéric

Frédéric de Villamil
[email protected] tel: +33 (0)6 62 19 1337
http://fredericdevillamil.com Typo : http://typosphere.org

de Villamil Frédéric said the following on 06/08/08 03:51 PM:

This is not a Typo but rails issue: to use a Rails application, you
need a database driver, ie ruby mysql driver. That’s the reason why
you needed so much dependencies. In an ideal world, your distro would
embed a package named ruby-mysql with the proper driver, or anything
else. The problem is Rails gem has its own dependencies system which
differs from RPM and you won’t register Typo MySQL gem with rpm and
the contrary.

Well I loaded up all the database “-devel” RPMs and got typo to install.
I still think this dependency should be documented and the justification
for the later version of the database interfaces explained. Perhaps
even a way to fall back…

So, that done I try to set up typo …
That fails still

[anton@laptop Ruby]$ mkdir typo-5.1.2; mkdir typo-5.1.2/db
[anton@laptop Ruby]$ typo install typo-5.1.2/db/emerge database=sqlite3
Installing typo 5.1.2
/usr/lib/ruby/gems/1.8/gems/rails-app-installer-0.2.0/lib/rails-installer/databases.rb:16:in
connect': undefined methodyml’ for RailsInstaller::Database:Class
(NoMethodError)
from
/usr/lib/ruby/gems/1.8/gems/rails-app-installer-0.2.0/lib/rails-installer/databases.rb:36:in
backup' from /usr/lib/ruby/gems/1.8/gems/rails-app-installer-0.2.0/lib/rails-installer.rb:261:inbackup_database’
from
/usr/lib/ruby/gems/1.8/gems/rails-app-installer-0.2.0/lib/rails-installer.rb:205:in
install_sequence' from /usr/lib/ruby/gems/1.8/gems/rails-app-installer-0.2.0/lib/rails-installer.rb:192:ininstall’
from
/usr/lib/ruby/gems/1.8/gems/rails-app-installer-0.2.0/lib/rails-installer/commands.rb:95:in
command' from /usr/lib/ruby/gems/1.8/gems/rails-app-installer-0.2.0/lib/rails-installer.rb:646:inexecute_command’
from /usr/lib/ruby/gems/1.8/gems/typo-5.1.2/bin/typo:93
from /usr/bin/typo:19:in `load’
from /usr/bin/typo:19


System Integrity Revisited
Rebecca T. Mercuri and Peter G. Neumann
Inside Risks 127, CACM 44, 1 January 2001

de Villamil Frédéric said the following on 06/08/08 03:51 PM:

[Big Snip of relevant material - review previous messages if you need it ]

This is not a Typo but rails issue: to use a Rails application, you
need a database driver, ie ruby mysql driver. That’s the reason why
you needed so much dependencies. In an ideal world, your distro would
embed a package named ruby-mysql with the proper driver, or anything
else.

Help me here.

Typo is built on and thus dependent on Rails
Rails is the part that needs the database drives, not Typo itself.

Is that correct?

So, if I were to use gem to remove the typo gem, update the various gems
that make up rails, probably activerecord in particular, doing whatever
compiles are necessary, and then used gem to install the typo gem, it
wouldn’t be a problem, because the database driver is in Rails not in
Typo.

So I do that and this is what I get:

[root@laptop ~]# gem update
Updating installed gems
Nothing to update
[root@laptop ~]# gem list | egrep “rails|action|active|typo”
actionmailer (2.1.0, 2.0.2, 2.0.1, 1.3.3, 1.3.2, 1.3.1, 1.2.5, 1.2.1,
1.0.1)
actionpack (2.1.0, 2.0.2, 2.0.1, 1.13.3, 1.13.2, 1.13.1, 1.12.5, 1.12.1,
1.9.1)
actionwebservice (1.2.6, 1.2.3, 1.2.1, 1.1.6, 1.1.2, 0.8.1)
activerecord (2.1.0, 2.0.2, 2.0.1, 1.15.3, 1.15.1, 1.14.4, 1.14.2,
1.11.1)
activeresource (2.1.0, 2.0.2, 2.0.1)
activesupport (2.1.0, 2.0.2, 2.0.1, 1.4.2, 1.4.0, 1.3.1, 1.1.1)
rails (2.1.0, 2.0.2, 2.0.1, 1.2.3, 1.2.2, 1.2.1, 1.1.6, 1.1.2)
rails_product (0.6, 0.5)
transaction-simple (1.4.0)
[root@lpatop ~]# gem install typo
Building native extensions. This could take a while…
ERROR: Error installing typo:
ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb install typo
checking for fdatasync() in -lrt… yes
checking for sqlite3.h… no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

The mkmf.log just repeats that and gives a list of compile options.

The problem is Rails gem has its own dependencies system which
differs from RPM and you won’t register Typo MySQL gem with rpm and
the contrary.

It would be nice if dynamic linking was used under Linux.
Never the less, it appears that Typo is trying to compile database
drivers of its own.

I’ve actually tried to reduce the number of dependencies in the last
releases, removing some of them as much as I could.

So what dependency is triggering this?
I have other rails applications on my laptop that use sqlite3 and mysql
with the installed rails gems. Surely that means I have a sqlite and
mysql driver that rails can make use of.

Surely dependencies would be one of the things that needs to be
documented!

Never the less, none of this addresses the problems I’ve had at
Deeamhost and when I’ve tried installing from the tarz-ball.
Please see my other mail under this subject heading.

Le 7 août 08 à 16:42, Anton J Aylward a écrit :

1.12.1, 1.9.1)
ERROR: Error installing typo:

drivers of its own.
Surely dependencies would be one of the things that needs to be
documented!

Never the less, none of this addresses the problems I’ve had at
Deeamhost and when I’ve tried installing from the tarz-ball.
Please see my other mail under this subject heading.

libsqlite3-devel or something like this

Regards
Frédéric

Frédéric de Villamil
[email protected] tel: +33 (0)6 62 19 1337
http://fredericdevillamil.com Typo : http://typosphere.org

Le 7 août 08 à 17:02, Anton J Aylward a écrit :

install.
database=sqlite3
from /usr/lib/ruby/gems/1.8/gems/rails-app-installer-0.2.0/
lib/rails-installer.rb:192:in install' from /usr/lib/ruby/gems/1.8/gems/rails-app-installer-0.2.0/ lib/rails-installer/commands.rb:95:in command’
from /usr/lib/ruby/gems/1.8/gems/rails-app-installer-0.2.0/
lib/rails-installer.rb:646:in execute_command' from /usr/lib/ruby/gems/1.8/gems/typo-5.1.2/bin/typo:93 from /usr/bin/typo:19:in load’
from /usr/bin/typo:19

Hello,

I understand your problem, so I’ll try to make it clear. Writing docs
is long, very long, and I’m currently alone doing it, along with a
real job, a family and even a bit of social life. I’d love to handle
every dependencies issues for every distro, but honnestly, I don’t
have time. There are many docs on the interweb that explains how to
setup a rails installation on (almost) every OS, because HURD and
Plan9 aren’t supported. Yet.

For your problem, I made a typo (sic) in the typosphere doc. Try
typo install typo-5.1.2/db/emerge database=sqlite

but using sqlite is not a very good idea.

Regards,
Frédéric

Frédéric de Villamil
[email protected] tel: +33 (0)6 62 19 1337
http://fredericdevillamil.com Typo : http://typosphere.org

de Villamil Frédéric said the following on 07/08/08 11:24 AM:

libsqlite3-devel or something like this
Indeed. Done. And that leads to other problems and still doesn’t
address the problems arising from trying to install from the tarz-ball

But figuring that out from the error messages is a poor way to work.

Is this formally documented anywhere?
is there a dependency tree documented?


The ability to learn faster than your competitors may be the only
sustainable competitive advatage.

  • Arie De Geus, Planning Coordinator
    Royal Dutch Shell

Esteban Manchado velázquez wrote:

Anton A. wrote:

I also get

ActionView::TemplateError (Couldn’t find template file for
/sidebars/sidebar/_content in ["~/typo5/themes/typographic/views",
“/~typo5/app/views”]) on
line #27 of themes/typographic/layouts/default.html.erb:
24: <%= render :partial => ‘shared/search’ %>
25:
26:
27: <%= render_sidebars %>
28:
29:
30:

I had the same problem, and found the solution (at least it worked for
me). The problem is that some leftovers in the sidebars table are left,
probably in the upgrade migrations.

What you have to do is open the console (in production environment or
whatever other environment you’re using for your blog) and remove the
sidebars that have undefined “type” (= nil). This line should do:

Sidebar.find(:all, :order => ‘active_position ASC’).find_all {|s|
s.type.nil?}.each {|s| s.destroy}

(Yeah, the line could be simpler, I just copy-pasted the line I just
used, while I was experimenting)

Gah! I just realised that this will delete the HTML blocks (e.g. with
links) that you may have, so you have to remake those. You should have a
backup copy of the database, even if you execute that thing first and
then read this message, so it shouldn’t be a problem…

Anton A. wrote:

I also get

ActionView::TemplateError (Couldn’t find template file for
/sidebars/sidebar/_content in ["~/typo5/themes/typographic/views",
“/~typo5/app/views”]) on
line #27 of themes/typographic/layouts/default.html.erb:
24: <%= render :partial => ‘shared/search’ %>
25:
26:
27: <%= render_sidebars %>
28:
29:
30:

I had the same problem, and found the solution (at least it worked for
me). The problem is that some leftovers in the sidebars table are left,
probably in the upgrade migrations.

What you have to do is open the console (in production environment or
whatever other environment you’re using for your blog) and remove the
sidebars that have undefined “type” (= nil). This line should do:

Sidebar.find(:all, :order => ‘active_position ASC’).find_all {|s|
s.type.nil?}.each {|s| s.destroy}

(Yeah, the line could be simpler, I just copy-pasted the line I just
used, while I was experimenting)

Esteban Manchado velázquez wrote:

Gah! I just realised that this will delete the HTML blocks (e.g. with
links) that you may have, so you have to remake those. You should have a
backup copy of the database, even if you execute that thing first and
then read this message, so it shouldn’t be a problem…

Uh, nevermind, in my case it seemed to delete only content that was
there by default, so you shouldn’t lose any data created by yourself. In
any case, make sure that you have the backup around, just in case.

Sorry for the noise, I panicked for a moment because I didn’t want
anyone to lose data because of my solution :slight_smile:

Esteban Manchado velázquez said the following on 07/08/08 04:40 PM:

Sorry for the noise, I panicked for a moment because I didn’t want
anyone to lose data because of my solution :slight_smile:

I’m sorry, after your ‘panic’ I deleted the previous messages.

Could you repeat that slowly, please…

After much fluffing around and quite possibly by accident I got the
version of Typo-5.1.2 running on my laptop. heartened by this I
returned to my Dreamhost account and tried once again to set up a
clean/new instance.

No luck.
The “typo install” went well. I’d set up GEN_HOME and GEM_PATH and PATH
and checked carefully that the gems being used were the ones I thought.
All looked fine until I tried running it. Neither the real nor the
admin interfaces worked - I got a 500 on each.

The logs reported …

Processing DashboardController#index (for 99.225.104.173 at 2008-08-07
19:50:00) [GET]
Session ID: 93269476e54e65f3421f49ddacabab13
Parameters: {“action”=>“index”, “controller”=>“admin/dashboard”}

NoMethodError (undefined method lang' for nil:NilClass): /app/controllers/application.rb:35:inload_lang’
/vendor/rails/actionpack/lib/action_controller/filters.rb:469:in
send!' /vendor/rails/actionpack/lib/action_controller/filters.rb:469:incall’
/vendor/rails/actionpack/lib/action_controller/filters.rb:441:in
`run’

Well hey, that’s different from before when it was complaining about
current_user being undefined this time.

So what’s up here? Is this another undocuemnted dependency?

Le 8 août 08 à 15:07, Anton J Aylward a écrit :

admin interfaces worked - I got a 500 on each.
/app/controllers/application.rb:35:in `load_lang’

So what’s up here? Is this another undocuemnted dependency?

Hello,

I remember running into this when I tried to build 5.0.3 gem. Can you
run ./script/console RAILS_ENV=your_current_environment and launch
Blog.find(:all)

If it returns nothing, then something went wrong during the install
process since you MUST have the default blog created at install.
Are you sure you’re running Rails 2.0.2 btw ?

I’ll be absent til sunday evening so don’t expect any reply before
monday

Cheers,
Frédéric

Frédéric de Villamil
[email protected] tel: +33 (0)6 62 19 1337
http://fredericdevillamil.com Typo : http://typosphere.org

de Villamil Frédéric said the following on 09/08/08 04:11 AM:

I remember running into this when I tried to build 5.0.3 gem. Can you
run ./script/console RAILS_ENV=your_current_environment and launch
Blog.find(:all)

I’'m sure you didn’t mean that!

$ ./script/console RAILS_ENV=development
Loading RAILS_ENV=development environment (Rails 2.0.2)
/home/.jordana/antonaylward/typo5/config/…/vendor/rails/railties/lib/initializer.rb:206:in
`read’:Errno::ENOENT: No such file or directory -
/home/.jordana/antonaylward/typo5/config/environments/RAILS_ENV=development.rb

:slight_smile:

[ralphie]$ RAILS_ENV=development ./script/console
Loading development environment (Rails 2.0.2)

Blog.find(:all)
=> []

[ralphie]$ RAILS_ENV=production ./script/console
Loading production environment (Rails 2.0.2)

Blog.find(:all)
=> []

If it returns nothing, then something went wrong during the install
process since you MUST have the default blog created at install.

OK, so (a) why would that have happened? I didn’t record it but the
install didn’t report any errors. (b) What to do about it.

Are you sure you’re running Rails 2.0.2 btw ?

Yes.

I’ll be absent til sunday evening so don’t expect any reply before
monday

:slight_smile:
its not life critical.


It is an error to imagine that evolution signifies a constant tendency
to increased perfection. That process undoubtedly involves a constant
remodelling of the organism in adaptation to new conditions; but it
depends on the nature of those conditions whether the directions of the
modifications effected shall be upward or downward.
Thomas H. Huxley

Anton A. wrote:

Esteban Manchado vel�zquez said the following on 07/08/08 04:40 PM:

Sorry for the noise, I panicked for a moment because I didn’t want
anyone to lose data because of my solution :slight_smile:

I’m sorry, after your ‘panic’ I deleted the previous messages.

Could you repeat that slowly, please…

Haha, sorry. The solution I posted in the first place works without
problems (in my case anyway), it was a false alarm.

So, what you have to do is: (1) open the console (in production
environment or
whatever other environment you’re using for your blog) and (2) remove
the
sidebars that have undefined “type” (= nil). This line should do:

Sidebar.find(:all, :order => ‘active_position ASC’).find_all {|s|
s.type.nil?}.each {|s| s.destroy}

That line could be simpler, and you may want to have a look and the
sidebar items you have in the database (in particular, the ones with
type = nil) before changing anything. Apart from that, it should work.

In any case, make sure you have a backup of your database. Just in case.