Question


I'm just start working with RoR and Heroku hosting.
I want to know how can I run application cloned from Heroku?
I want to add some migration for field. Can I do it right on Heroku without cloning?

What I'm doing:
1) heroku login
2) git clone git.....
3) cd cloned_app_folder
4) bundle install
5) rails g migration add_field_to_posts field:string
On this stage I have many errors: like database.yml not exists and error in configuration.rb, /active_support/lazy_load_hooks.rb and other
6) I'm loaded db schema but it didn't help me

Was it helpful?

Solution

I dont think you can do a straight migration on Heroku.

Check and make sure you have a database.yml in the config folder.

If not and you are using postgres create one that looks something like this

development:
  adapter: postgresql
  encoding: unicode
  database: APP_NAME_development
  pool: 5
  username: COMPUTER_USER_NAME
  password:

test:
  adapter: postgresql
  encoding: unicode
  database: APP_NAME_test
  pool: 5
  username: COMPUTER_USER_NAME
  password:

production:
  adapter: postgresql
  encoding: unicode
  database: APP_NAME_production
  pool: 5
  username: COMPUTER_USER_NAME
  password:

If you already have the above, then run rake db:create and then rake db:migrate.

Then you should be able to run your migration.

Let me know if this doesn't solve the problem!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top