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'
    end

    group :production do
      gem 'pg'
    end

# ~/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
    http://myror1.herokuapp.com/ | git@heroku.com:myror1.git
    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: http://myror1.herokuapp.com

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.
Done!
New prokect is at ~/git/heroku/myror1

4. Next steps

For adding models and doing great things, see:
http://guides.rubyonrails.org/getting_started.html

No comments:

Post a Comment