sth about initial project with rails,github,heroku

#0 

Get a heroku user-acount

-----------------------------------------------

#1

$ heroku login

-----------------------------------------------

#2,install rails by rvm if you haven't install it

$ gem install rails --no-ri --no-rdoc 

$ rails new myapp --database=postgresql

$ cd myapp

$ rails generate controller welcome



----------------------------------------------    

app/views/welcome/index.html.erb:   

<h2>Hello World</h2>

     <p>   The time is now: 

    <%= Time.now %>

     </p>



-----------------------------------------------

 onfig/routes.rb:  

root 'welcome#index'



-----------------------------------------------

$ rails server



----------------------------------------------

Gemfile:   

gem 'sqlite3' ---->gem 'pg'

    #at the end add:

    gem 'rails_12factor', group: :production

    ruby "2.0.0"



-----------------------------------------------

$ bundle install

-----------------------------------------------

config/database.yml:

    #remove next line

        username: myapp

    #change word like this                 

development:

               adapter: postgresql 

              encoding: unicode 

              database: myapp_development 

              pool: 5 

              password:



        ..............

-------------------------------------------------

$ bundle install

$ git init 

$ git add . 

$ git commit -m "init"

$ git status

$ heroku create

$ git push heroku master

$ heroku run rake db:migrate

$ heroku ps:scale web=1

$ heroku open

sth about initial project with rails,github,heroku

#That's all.Pleasure for your using!

   


你可能感兴趣的:(github,Rails,heroku)