$ rails --version
$ gem install rails
$ rails new <Application Name>
$ cd <Application Name> $ rails server
In case you encounter the error message of "Could not find a JavaScript runtime.", execute the following commands.
$ gem install execjs $ gem install therubyracer
Open the Gemfile and append the following lines.
$ vi Gemfile
gem ‘execjs’ gem ‘therubyracer’
$ bundle install
http://localhost:3000/
$ rails generate controller <Controller Name> <Method(View)> <Method(View)>(Example)
$ rails generate controller Say hello goodbye
http://localhost:3000/say/hello/
#ref(): File not found: "CreateApplication_fig2.png" at page "HowToUse/RubyOnRails/4.1"
$ rvm install ruby-2.2.2
$ wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh
When you encounter error, you can use standalone edition with the following commands.
$ wget -qO- https://toolbelt.heroku.com/install.sh | bash $ echo 'PATH="/usr/local/heroku/bin:$PATH"' >> ~/.profile
$ heroku login
$ git clone <Git Repository>
or
$ cd <Ruby On Rails Project> $ git init $ git add . $ git commit -m "initial commit"
$ vi config/Gemfile
+gem 'pg' -gem 'sqlite3' +gem 'sqlite3', group: %w(test development), require: false +gem 'pg', group: %w(production), require: false
$ bundle install
$ vi db/database.yml
production: <<: *default - database: db/production.sqlite3 + adapter: pg + database: db/production.pg
$ heroku create <application name>
$ git push heroku master
S.Yatsuzuka