Asset Manager Extension Issues

Hello-

I’m hoping someone can point out what I’m doing wrong with the Asset
Manager…

I installed Radiant on Dreamhost and all went well.

I installed the acts_as_attchment plugin and it still looked good.

I checked the gems and rmagick (1.10.1) is installed.

When I click on the ‘Images’ tab from the admin I get this error in
the production.log:

LoadError (Expected
…/config/…/vendor/extensions/assets/app/models/asset.rb to define
Asset):
/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:250:in
`load_missing_constant’

When I fire up the console in production mode and try to create a new
Asset
a = Asset.new
I get:

NameError: uninitialized constant
Technoweenie::ActsAsAttachment::ActMethods::InstanceMethods from
./script/…/config/…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:264:in
`load_missing_constant’

Any suggestions on what to try? The full stack traces are below.

Thanks-
Michael

FULL ERRORS:

LoadError (Expected
…/config/…/vendor/extensions/assets/app/models/asset.rb to define
Asset):
/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:250:in
load_missing_constant' /vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:453:inconst_missing’
/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:465:in
const_missing' /vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:261:inload_missing_constant’
/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:453:in
const_missing' /vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:261:inload_missing_constant’
/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:469:in
const_missing' /vendor/extensions/assets/app/controllers/admin/asset_controller.rb:11:inindex’
/vendor/rails/actionpack/lib/action_controller/base.rb:1095:in
send' /vendor/rails/actionpack/lib/action_controller/base.rb:1095:inperform_action_without_filters’
/vendor/rails/actionpack/lib/action_controller/filters.rb:632:in
call_filter' /vendor/rails/actionpack/lib/action_controller/filters.rb:638:incall_filter’
/vendor/rails/actionpack/lib/action_controller/filters.rb:438:in
call' /vendor/rails/actionpack/lib/action_controller/filters.rb:637:incall_filter’
/vendor/rails/actionpack/lib/action_controller/filters.rb:638:in
call_filter' /vendor/rails/actionpack/lib/action_controller/filters.rb:438:incall’
/vendor/rails/actionpack/lib/action_controller/filters.rb:637:in
call_filter' /vendor/rails/actionpack/lib/action_controller/filters.rb:638:incall_filter’
/vendor/rails/actionpack/lib/action_controller/filters.rb:438:in
call' /vendor/rails/actionpack/lib/action_controller/filters.rb:637:incall_filter’
/vendor/rails/actionpack/lib/action_controller/filters.rb:619:in
perform_action_without_benchmark' /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:inperform_action_without_rescue’
/usr/lib/ruby/1.8/benchmark.rb:293:in measure' /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:inperform_action_without_rescue’
/vendor/rails/actionpack/lib/action_controller/rescue.rb:83:in
perform_action' /vendor/rails/actionpack/lib/action_controller/base.rb:430:insend’
/vendor/rails/actionpack/lib/action_controller/base.rb:430:in
process_without_filters' /vendor/rails/actionpack/lib/action_controller/filters.rb:624:inprocess_without_session_management_support’
/vendor/rails/actionpack/lib/action_controller/session_management.rb:114:in
process' /vendor/rails/actionpack/lib/action_controller/base.rb:330:inprocess’
/vendor/rails/railties/lib/dispatcher.rb:41:in dispatch' /vendor/rails/railties/lib/fcgi_handler.rb:168:inprocess_request’
/vendor/rails/railties/lib/fcgi_handler.rb:143:in
process_each_request!' /vendor/rails/railties/lib/fcgi_handler.rb:109:inwith_signal_handler’
/vendor/rails/railties/lib/fcgi_handler.rb:142:in
process_each_request!' /usr/lib/ruby/1.8/fcgi.rb:600:ineach_cgi’
/usr/lib/ruby/1.8/fcgi.rb:597:in each' /usr/lib/ruby/1.8/fcgi.rb:597:ineach_cgi’
/vendor/rails/railties/lib/fcgi_handler.rb:141:in
process_each_request!' /vendor/rails/railties/lib/fcgi_handler.rb:55:inprocess!’
/vendor/rails/railties/lib/fcgi_handler.rb:25:in `process!’
dispatch.fcgi:24

NameError: uninitialized constant
Technoweenie::ActsAsAttachment::ActMethods::InstanceMethods
from
./script/…/config/…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:264:in
load_missing_constant' from ./script/../config/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:453:inconst_missing’
from
./script/…/config/…/config/…/vendor/plugins/acts_as_attachment/lib/technoweenie/acts_as_attachment.rb:51:in
acts_as_attachment' from ./script/../config/../config/../vendor/extensions/assets/app/models/asset.rb:7 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:18:inrequire__’
from
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:18:in
require' from ./script/../config/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:inrequire’
from
./script/…/config/…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:343:in
new_constants_in' from ./script/../config/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:inrequire’
from
./script/…/config/…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:105:in
require_or_load' from ./script/../config/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:249:inload_missing_constant’
from
./script/…/config/…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:453:in
const_missing' from ./script/../config/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:465:inconst_missing’
from (irb):1

Yes, I have the table:

mysql> desc assets;
±-------------±-------------±-----±----±--------±---------------+
| Field | Type | Null | Key | Default | Extra |
±-------------±-------------±-----±----±--------±---------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| title | varchar(255) | YES | | NULL | |
| content_type | varchar(255) | YES | | NULL | |
| filename | varchar(255) | YES | | NULL | |
| size | int(11) | YES | | NULL | |
| parent_id | int(11) | YES | | NULL | |
| thumbnail | varchar(255) | YES | | NULL | |
| width | int(11) | YES | | NULL | |
| height | int(11) | YES | | NULL | |
| created_at | datetime | YES | | NULL | |
| created_by | int(11) | YES | | NULL | |
| updated_at | datetime | YES | | NULL | |
| updated_by | int(11) | YES | | NULL | |
| page_id | int(11) | YES | | NULL | |
±-------------±-------------±-----±----±--------±---------------+
14 rows in set (0.01 sec)

And I have the ‘extensions_meta’ table.

Hi,
Do you have an assets table in the db? Did you run ‘rake
db:migrate:extensions’?

Todd

Quoting M. Jones [email protected]:

When I click on the ‘Images’ tab from the admin I get this error in
the production.log:

LoadError (Expected
…/config/…/vendor/extensions/assets/app/models/asset.rb to define
Asset):

/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:250:in

`load_missing_constant’

When I fire up the console in production mode and try to create a new Asset
a = Asset.new
I get:

NameError: uninitialized constant
Technoweenie::ActsAsAttachment::ActMethods::InstanceMethods from

./script/…/config/…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:264:in

FULL ERRORS:

LoadError (Expected
…/config/…/vendor/extensions/assets/app/models/asset.rb to define
Asset):

/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:250:in

`load_missing_constant’

/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:453:in

`const_missing’

/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:465:in

`const_missing’

/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:261:in

`load_missing_constant’

/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:453:in

`const_missing’

/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:261:in

`load_missing_constant’

/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:469:in

call_filter' /vendor/rails/actionpack/lib/action_controller/filters.rb:438:in call’
perform_action' /vendor/rails/railties/lib/fcgi_handler.rb:168:in process_request’
/vendor/rails/railties/lib/fcgi_handler.rb:55:in `process!’

./script/…/config/…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:264:in

`load_missing_constant’
from

./script/…/config/…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:453:in

`const_missing’
from

./script/…/config/…/config/…/vendor/plugins/acts_as_attachment/lib/technoweenie/acts_as_attachment.rb:51:in

`acts_as_attachment’
from

./script/…/config/…/config/…/vendor/extensions/assets/app/models/asset.rb:7

    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:18:in

require__' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:18:in require’
from

./script/…/config/…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:496:in

`require’
from

./script/…/config/…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:343:in

`new_constants_in’
from

./script/…/config/…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:496:in

`require’
from

./script/…/config/…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:105:in

`require_or_load’
from

./script/…/config/…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:249:in

`load_missing_constant’
from

./script/…/config/…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:453:in

`const_missing’
from

./script/…/config/…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:465:in

What version of Rails is it running. Remember you have to freeze edge
(although 1.2 is out now, so maybe you can just freeze 1.2).
I also had trouble with acts_as_attachment, but it had to do with the
changes to how modules are loaded in /vendor.
I sent my updates to the maintainer Keith.

I modified the acts_as_attachment/init.rb and put the following lines
at the top of the file:
require ‘db_file’
require ‘technoweenie/acts_as_attachment’
require ‘technoweenie/acts_as_attachment/class_methods’
require ‘technoweenie/acts_as_attachment/db_file_methods’
require ‘technoweenie/acts_as_attachment/file_system_methods’
require ‘technoweenie/acts_as_attachment/instance_methods’

Note: I also integrated lightbox, so if you want a zip of my whole
extensions dir I can email it to you…

HTH,
Adam

There has been alot of email about this, I’d suggest starting by
digging through the archives a bit, I do remember a recent thread
about how to migrate from trunk to mental and migration scripts.

In short the big difference is Extensions.

BTW: I bet alot of other people are gonna have the same questions you
have, would you be willing to put together a wiki entry that answers
these questions? I’m sure if you were willing to do this than some of
the radiant guru’s would gladly give you some great copy!

Cheers-
MJ

Hello all!

Well, I’m back again. Been enjoying 0.5.2. Been watching the mailgroup
for a bit. I know there is significantly newer versions of Radiant
through svn. Doesn’t have to be in layman’s terms, I am just stumped at
the difference between Trunk and Mental and would kind of like a summary
of it. As well, will it be easy to port between the two when Mental goes
live? (If it goes live)

Thanks all!
Andrew

Adam you ROCK!

Thanks so much for that info, I’m now uploading assets.