Page 103, the migration for adding the cover column does not seem to
work.
$ script/generate migration add_book_cover_column
class AddBookCoverColumn < ActiveRecord::Migration
def self.up
add_column :books, :cover_image, :string
end
def self.down
remove_column :books, :cover_image
end
end
When I do the “rake migrate”, I get table books already exists error
message.
Can someone tell me how to get this to work? TIA.
I remember something similar to that error. I will post the actual error
message when I get back home. For the time being you can comment out the
assertions that is checking for those tags.
This is really annoying, author has not responded to my emails. Apress
does
not have any forum for errata help. Do the authors and the publisher
still
live in caves? Book is good but the support is poor compared to other
publishers like Pragmatic programmers and Manning.
I have encountered two problems so far, one with migration and the other
with assertion that checks for html tags. To see what was going on with
the
migration, I did: rake db:migrate --trace
For some weird reason it seems to think that it has to run the migration
for
create tables (the previous migration) as well as the add cover_image
column
migration. For the time being, I commented out the entire file for the
create books table and author_books table in the migration before add
cover_image column migration.
Heads up on another issue, the book does not tell you to install
RedCloth. You will run into problem on page number 128. So you must
install RedCloth to use the textilize method. On Mac I did this: sudo
gem install RedCloth
One of the things that the book does not mention is that the fixtures
that
you use must have proper data. Copy all the fixtures files from the
downloaded source and give it a shot. It may not solve all problems but
atleast we have exhausted all options.
After reading all the posts on this thread, it appears I am having the
same problems with any tests that check for assert_tag ‘’, :content
=> ‘(some content)’. I have also gone ahead and commented the assert_tag
out and then the tests work just fine, but it is really annoying.
Especially since it is documented in the book. I have also copied the
files from the source code I downloaded from Apress and it still fails.
Has anyone been able to get this to work or at least figure out what is
causing the error? Please help!
I have tried to fix this problem extensively without any success.
Comment out the line with assert_tag and keep going.
One thing very frustrating about this otherwise excellent book
(Beginning Ruby on Rails E-Commerce) is that the authors have not set
up a site to provide feedback/fixes etc.
Bharat
They have a companion site at http://www.railsecommerce.com/ but I
don’t know if there’s a defined mechanism for feedback. Perhaps an
e-mail to Jarkko will suffice?
There seem to be some problems with some of the examples, so hopefully
they can get something up soon on there! The mailing list isn’t the
best place for these kinds of things (especially since Jarkko isn’t
involved in these conversations!).
This weekend was ruined because of this book. I am actually exhausted
from
trying to learn from this book. I worked this book till page 112 and
deleted
everything and started all over again to see if I can get it running.
This
book is just draining my energy.
I would suggest others to stay away from this book. Unless you have lot
of
time and energy to waste. You can think about buying this book if the
publisher comes up with a revised edition that fixes all the problems.
There is another related thread on this list. Change the test_process.rb
to
the implementation shown below:
— vendor/rails/actionpack/lib/action_controller/test_process.rb
def html_document
HTML::Document.new(@response.body)
end
Let us know if that fixes the problem.
I tried this and it seems to work for some of the tests, but in turn,
produces a numerous amount of additional errors in other parts of the
testing.
I have to say that I am disappointed in this book. I think a good effort
was made in putting this out for programmers, but I find myself spending
more time trying to figure out what went wrong than actually learning. I
even copy over the folders from the source code I downloaded from the
authors and the code fails. Very frustrating.
I hit a wall with the book as well. Eventually I ditched the TDD and
just kept moving forward. There is some good stuff to learn about
implementing search, ajax, etc. This book converted me to migrations as
well. The unit tests are good reading to understand what is happening
under the hood but I’ll be damned if I wrote them after they started
failing with wierd configuration errors. I still read them though.
The chapter on forums is pretty good though I challenged myself to roll
my own forum and did it in less than 2 hours (and I’m a terrible
programmer!) Eventually you come to realize that this book is mainly
about TDD and integrating plugins. It does cover things that aren’t
widely explained like e-commerce and deployment. Just don’t get bogged
down if a test fails - I didn’t! Focus on the programming concepts.
Readers don’t really care if George is threatening you with offshoring
or if
he does not have money to hire programmers, they care only about getting
the
code work so that they can learn something from the book.
It is very annoying to read about irrelevant things about George The
Great
when the relevant instructions are missing. It would not hurt to repeat
the
instructions to get the code running. Sorry for the rant, but George
really
pisses me off.
One of the things that the book does not mention is that the fixtures that
you use must have proper data. Copy all the fixtures files from the
downloaded source and give it a shot. It may not solve all problems but
atleast we have exhausted all options.
Actually, on page 114:
“Therefore, we need to expand our … fixture files in test/fixtures.
You can download the files from the Source Code/Downloads section of www.apress.com.”
There were just no idea to list all the fixtures in the book. So after
that point the book assumes you have the downloaded fixtures. Before
it, you should not need them if you have created the fixtures like told
in the book.