On Tue, Nov 3, 2009 at 11:27 PM, H.P.L. <[email protected]> wrote:
>
> I'm new to Rails, coming from Python (Django) and PHP (Zend), and have
> an issue trying to move my application from development to production.
> It's a little mysterious to me, but I'm sure it's something simple
> that I've completely overlooked.
>
> Without getting to in depth, I'm comfortable with developing, but I'm
> taking the steps in moving applications from my development machine to
> a virtual production machine. The Production machine is a Debian Lenny
> box running ruby 1.8.7, Rails 2.3.4, and Mongrel 1.1.5. I've set up a
> quick and simple "todo list" app for this task by running:
> rails todo -d mysql
> cd todo
> { mate | vim } config/database.yml
> rake db:create:all
> script/generate scaffold Todo title:string body:text done:boolean
> due:datetime
> rake db:migrate
>
> And when I run script/server, everything runs great, and I can see no
> errors in the logs. If I evoke mongrel_rails directly on the
> application by:
> sudo mongrel_rails start -e development -p 8000 -a 127.0.0.1 -P tmp/
> pids/mongrel-1.pid
>
> I get the exact same effect (as I understand I am essentially doing
> the same thing as script/server). But when I evoke mongrel_rails to
> run as production:
> sudo mongrel_rails start -e production -p 8000 -a 127.0.0.1 -P tmp/
> pids/mongrel-1.pid
>
> Then I can pull up the public/index.html with no problem, but
> navigating to http://example.com/todos I'll get the dreaded "We're
> sorry, but something went wrong. (500)" page, and my log/
> production.log delivers:
>
> ActiveRecord::StatementInvalid (Mysql::Error: Table
> 'todo_production.todos' doesn't exist: SELECT * FROM `todos` ):
>   app/controllers/todos_controller.rb:5:in `index'
>
> Rendering /var/rails/todo/public/500.html (500 Internal Server Error)
>
> Which can be confirmed by opening up the production database,
> todo_production, and noting that it is empty. What have I overlooked?
Apparantly nothing, rake db:create:all should create all you databases
defined on config/database.yml
Are you sure the specified production configuration is a valid configuration?
Have you tried?:
rake db:create RAILS_ENV=production

Hope it helps.

-- 
Leonardo Mateo.
There's no place like ~

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to