and it looks like everything installed fine. So I fired up Webrick and
tried to upload an image (I changed it from dvd_covers to book_covers,
but otherwise no changes.)
When I select my image on the New page, and click create I get an error:
ActiveRecord::RecordNotFound in Book coversController#show
Couldn't find BookCover with ID=0
Request
Parameters: {"id"=>"0"}
An item is added to the database with id=1, and the file is "uploaded"
to the public/book_covers/ directory. If I then try to look at the
file by going to /localhost/book_covers/ and clicking on the item
that's listed, I get a missing image and another error in the log:
Session ID: 345f86366e41bc32e5883f3fbffa1efd
Parameters: {"action"=>"show", "id"=>"0", "controller"=>"book_covers"}
BookCover Load (0.000822) SELECT * FROM book_covers WHERE
(book_covers.id = '0') LIMIT 1
ActiveRecord::RecordNotFound (Couldn't find BookCover with ID=0):
I don't know why it's looking for id = 0, the link in the index page is:
<li><a href="/book_covers/show/1">06.jpg</a></li>
and on the show page:
and it looks like everything installed fine. So I fired up Webrick and
tried to upload an image (I changed it from dvd_covers to book_covers,
but otherwise no changes.)
When I select my image on the New page, and click create I get an error:
ActiveRecord::RecordNotFound in Book coversController#show
Couldn't find BookCover with ID=0
Request
Parameters: {"id"=>"0"}
An item is added to the database with id=1, and the file is "uploaded"
to the public/book_covers/ directory. If I then try to look at the
file by going to /localhost/book_covers/ and clicking on the item
that's listed, I get a missing image and another error in the log:
Session ID: 345f86366e41bc32e5883f3fbffa1efd
Parameters: {"action"=>"show", "id"=>"0", "controller"=>"book_covers"}
BookCover Load (0.000822) SELECT * FROM book_covers WHERE
(book_covers.id = '0') LIMIT 1
ActiveRecord::RecordNotFound (Couldn't find BookCover with ID=0):
I don't know why it's looking for id = 0, the link in the index page is:
<li><a href="/book_covers/show/1">06.jpg</a></li>
and on the show page:
<img alt="06" src="/book_covers/1/06.jpg?" />
Did I miss something?
Thanks,
John
Just a quick followup - the image is uploaded, but the path it's uploaded to is:
public/book_covers/0/test.jpg
I don't know why it's showing 0. The database clearly shows id = 1:
I got the tests to run by editing the database.yml file within the
test folder of the plugin to only use sqlite3 (I'd figure it would
pick the right database - guess not..)
But that doesn't help. That generated:
47 tests, 35 assertions, 0 failures, 39 errors
rake aborted!
Command failed with status (1): [/usr/local/bin/ruby -Ilib:test "/usr/local...]
Here's the results of the first test:
1) Error:
test_filesystem_size_for_file_attachment(AttachmentTest):
ActiveRecord::RecordNotFound: Couldn't find FileAttachment with ID=0
The different configs are there so you can choose the one that matches up
with your system. I just did the same exact set of steps to see if I could
repro your bug and I get:
Finished in 2.989249 seconds.
47 tests, 255 assertions, 0 failures, 0 errors
Not too comforting, right? I suggest you create a fresh rails project,
install the plugin from svn, edit the database.yml, then run the tests. That
way you can reassure yourself that the plugin should be passing its tests. I
suspect it will pass the tests. Then compare to see what's different between
the fresh install and your current project.
The different configs are there so you can choose the one that matches up
with your system. I just did the same exact set of steps to see if I could
repro your bug and I get:
Finished in 2.989249 seconds.
47 tests, 255 assertions, 0 failures, 0 errors
Not too comforting, right? I suggest you create a fresh rails project,
install the plugin from svn, edit the database.yml, then run the tests. That
way you can reassure yourself that the plugin should be passing its tests. I
suspect it will pass the tests. Then compare to see what's different between
the fresh install and your current project.
Thanks for the suggestion. I created a new project, installed the
plugin, edited the database.yml file and ran the tests:
47 tests, 35 assertions, 0 failures, 39 errors
rake aborted!
Command failed with status (1): [/usr/local/bin/ruby -Ilib:test "/usr/local...]
1) Error:
test_filesystem_size_for_file_attachment(AttachmentTest):
ActiveRecord::RecordNotFound: Couldn't find FileAttachment with ID=0
There are some messages about the most current version of the plugin
needing edge rails, so I deleted the plugin and installed the 1.1.6
version. Save errors. (all I need to do is rm -R acts_as_plugin to
delete the old one, right?)
It shouldn't be too different. And yes, to uninstall the plugin rm -Rf
should work.
So others may help with this, what OS are you running (Web server doesn't
really matter if you're not even passing the tests)? Also, have you
successfully done *anything* with sqlite3? Just grasping at straws, but
maybe you have a bad build?
I tried the same test on another system (creating a new rails app,
install the plugin (1.1.6 version) and run the tests. On this system,
the tests passed. The difference is, the second system does have
ImageMagick/Rmagick installed.
Does the plugin require Imagemagick? I thought it didn't, but I'm
thinking that it just might.
Yes, if that's all you're getting in the test failures, I wouldn't
worry about it. For now, you'll just miss out on all the swanky
resizing/thumbnailing aspects without RMagick. The rest of the plugin
should work though.