I’m just learning to use rake and ran into the following problem:
chraftbuech:/Users/Josh/Webwork/CommentingSystem josh$ rake
Create test news
The task’s code is:
desc ‘Creates some test news items with comments’
task ‘create_test_news’ do
puts ‘Create test news’
n = NewsItem.new
n.subject = ‘This is the first news item’
n.body = ‘After days of work this is the first news item ever
published using the NewsEngine. Have fun with it and add some comments!
raise ‘Could not save first news item!’ if !n.save
Can you tell me what I have to do to establish the connection? I guess
somehow Rails doesn’t connect to MySQL?
Thanks for help.