Create a New Ruby on Rails project in Eclipse for Horeku

1. Create Ruby on Rails project in Eclipse

Eclipse -> New -> Project -> Rails -> Use Standard rails Generator

# ~/workspace/myror1

Modify Gemfile

    group :development, :test do
      gem 'sqlite3'
#      gem 'ruby-debug19', :require => 'ruby-debug'     # conflicts with Aptina Eclipse Debugger
      gem 'database_cleaner'

    group :production do
      gem 'pg'

# ~/workspace/myror1$
bundle install

Confirm default project is working locally

rails server

2. Git & Heroku

# Add project to (temp) git repostory, so that it can be pushed to heroku:

git init
git add .
git commit -m "init"

## Deploy your application to Heroku:

# Create the app on Heroku:
heroku apps:create myror1
    Creating myror1... done, stack is cedar |
    Git remote heroku added

==> Adds [remote 'heroku'] entry to .git/config, which is used while pushing in command below.

# Deploy your code:
git push heroku master
Check it:

3. Import newly created Heroku  project into Eclipse

# Delete current project and import the one with identical name from Heroku:
cd ~/workspace
Eclipse -> Project Delete myror1
Eclipse -> Import Existing Heroku App -> Auto detected project.
New prokect is at ~/git/heroku/myror1

4. Next steps

For adding models and doing great things, see:

No comments:

Post a Comment