スポンサーリンク

Railsチュートリアル第3章

Gemfileを以下でtry

———–

source ‘https://rubygems.org’

# Bundle edge Rails instead: gem ‘rails’, github: ‘rails/rails’
gem ‘rails’, ‘4.2.2’
# Use SCSS for stylesheets
gem ‘sass-rails’, ‘~> 5.0’
# Use Uglifier as compressor for JavaScript assets
gem ‘uglifier’, ‘>= 1.3.0’
# Use CoffeeScript for .coffee assets and views
gem ‘coffee-rails’, ‘~> 4.1.0’
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem ‘therubyracer’, platforms: :ruby

# Use jquery as the JavaScript library
gem ‘jquery-rails’
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem ‘turbolinks’
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem ‘jbuilder’, ‘~> 2.0’
# bundle exec rake doc:rails generates the API under doc/api.
gem ‘sdoc’, ‘~> 0.4.0’, group: :doc

# Use ActiveModel has_secure_password
# gem ‘bcrypt’, ‘~> 3.1.7’

# Use Unicorn as the app server
# gem ‘unicorn’

# Use Capistrano for deployment
# gem ‘capistrano-rails’, group: :development

group :development, :test do
  # Use sqlite3 as the database for Active Record
  gem ‘sqlite3’
  # Call ‘byebug’ anywhere in the code to stop execution and get a debugger console
  gem ‘byebug’
  # Access an IRB console on exception pages or by using <%= console %> in views
  gem ‘web-console’, ‘~> 2.0’
end

group :test do
  gem ‘minitest-reporters’, ‘1.0.5’
  gem ‘mini_backtrace’,     ‘0.1.3’
  gem ‘guard-minitest’,     ‘2.3.1’
  gem ‘spring’,      ‘1.1.3’
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem ‘tzinfo-data’, platforms: [:mingw, :mswin, :x64_mingw, :jruby]

group :production do
  gem ‘pg’,             ‘0.17.1’
  gem ‘rails_12factor’, ‘0.0.2’
end

# cd c:/rails/sample_app

———–

Windows 8.1で、AptanaStudio3をつかっていたのだが、Herokuがうまくいっていないのではなくて、

image

の、herokuのアドレスをクリックすると、

https//blooming-everglades-4463.herokuapp.com/

という、https のあとに、「:」が入っていないアドレスにリンクが飛んで、Page not found になるのだが、https と、 blooming の間に、: を入れると、ちゃんと表示された。これがうまくいかない原因だったのかもしれない。

●Herokuをうまくいかせるコツ

(1)Gemfileの最後に、

——————

group :production do
  gem ‘pg’,             ‘0.17.1’
  gem ‘rails_12factor’, ‘0.0.2’
end

——————

を入れる。

(2)git について勉強しておいて、heroku toolbeltも入れておいて、あとは、

http://qiita.com/ikuwow/items/8b8aa9ac8990f98691a9

の通りにやる。

 

AptanaStudioでは、rake testをすると、ターミナルが次の入力を受け付けなくなてってしまう。。。おしい。。。

Cygwin かな。。。?

http://takuya-1st.hatenablog.jp/entry/20111121/1321865738

http://news.mynavi.jp/articles/2013/08/06/cygwin/

http://qiita.com/kanpou_/items/0764381301d37e04157b

スポンサーリンク