Crea Y Lanza Una Aplicacion Rails
Paso 1: Cámbiate a tu directorio de inicio
WindowsType this in the terminal:cd c:\SitesMac o LinuxType this in the terminal:cd ~
Paso 2: Crea el directorio railsbridge
Type this in the terminal:mkdir railsbridge
Paso 3: Cámbiate a tu nuevo directorio railsbridge
Type this in the terminal:cd railsbridge
Paso 4: Crea una nueva aplicación Rails
Type this in the terminal:rails new test_appType this in the terminal:cd test_appType this in the terminal:rails serverApproximate expected result:=> Booting WEBrick => Rails 3.2.x application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2010-09-30 21:04:12] INFO WEBrick 1.3.1 [2010-09-30 21:04:12] INFO ruby 1.9.3 (2012-11-10) [x86_64-darwin10.4.2] [2010-09-30 21:04:12] INFO WEBrick::HTTPServer#start: pid=24805 port=3000El texto en gris puede diferir y no importa.
Paso 5: Genera un modelo de base de datos
Type this in the terminal:rails generate scaffold user name:string email:string address:text active:booleanType this in the terminal:rake db:migrateType this in the terminal:rails server
Paso 6: Utiliza git
Type this in the terminal:git initExpected result:Initialized empty Git repository in c:/Sites/test_app/.git/Type this in the terminal:git add -AType this in the terminal:git commit -m "initial commit"Expected result:muchas líneas como create mode 100644 GemfileType this in the terminal:git logExpected result:(Tu nombre en git y mensaje del "commit inicial".)
Paso 7: Lanza tu aplicación a Heroku
Paso 7.1: Crea una aplicación de Heroku desde esta aplicación de Rails local
Type this in the terminal:heroku createExpected result:Enter your Heroku credentials. Email: myemail@example.com Password: Uploading ssh public key /Users/smei/.ssh/id_rsa.pub Creating floating-winter-18... done, stack is cedar http://floating-winter-18.heroku.com/ | git@heroku.com:floating-winter-18.git Git remote heroku addedType this in the terminal:git remote showExpected result:herokuPaso 7.2: Prepara tu aplicación Rails para lanzarla a Heroku
gem 'sqlite3'
group :development, :test do gem 'sqlite3' end group :production do gem 'pg' gem 'rails_12factor' endType this in the terminal:bundle install --without productionPaso 7.3: Agregar mis cambios a git
Type this in the terminal:git add . git commit -m "Updates for heroku deployment"Paso 7.4: Lanza a Heroku
Type this in the terminal:git push heroku masterExpected result:The authenticity of host 'heroku.com (75.101.145.87)' can't be established. RSA key fingerprint is 8b:48:5e:67:0e:c9:16:47:32:f2:87:0c:1f:c8:60:ad. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'heroku.com,75.101.145.87' (RSA) to the list of known hosts. Counting objects: 60, done. Compressing objects: 100% (54/54), done. Writing objects: 100% (60/60), 79.03 KiB, done. Total 60 (delta 10), reused 0 (delta 0) -----> Heroku receiving push -----> Rails app detected Compiled slug size is 080K -----> Launching...... done App deployed to Heroku To git@heroku.com:floating-winter-18.git * [new branch] master -> masterType this in the terminal:heroku run rake db:migrateExpected result:Running rake db:migrate attached to terminal... up, run.1 Migrating to CreateUsers (20111204065949) == CreateUsers: migrating ==================================================== -- create_table(:users) -> 0.0122s == CreateUsers: migrated (0.0123s) ===========================================Paso 7.5: Visita tu nueva aplicación
Siguiente Paso:
Ir a Consigue Un Sticker
Regresar a Crea Una Cuenta De Heroku