2016-05-03から1日間の記事一覧
Your Gemfile has no gem server sources. If you need gems that are not already on your machine, add a line like this to your Gemfile: source 'https://rubygems.org' と怒られた時の対処法 英文読めば分かるですが自分が読まずに調べてしまったので……
each_with_index Rubyの each でインデックスを取得したい場合 each_with_index を使う。 %w(a b c).each_with_index do |n, index| puts "#{index} #{n}" end # 0 a # 1 b # 2 c インデックスを任意の数字から始める with_index indexを1から始めたい場合な…