LoginSignup
1
0

More than 5 years have passed since last update.

Rails-tutorial初心者

Last updated at Posted at 2018-10-19

2章 toy_app

↓bitbucketにpushするときに毎回でるのかな?

[vagrant@localhost toy_app]$ git push -u origin --all
To git@bitbucket.org:[username]/toy_app.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@bitbucket.org:[username]/toy_app.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again.  See the 'Note about
fast-forwards' section of 'git push --help' for details.

<つまづきポイント>
bitbucketでpushできなくて、30分苦戦したけどなんとかクリア。あとで理解できたらいいな。
git pushがrejectされたときの解決方法URLまとめ

gitについて

以下のコマンドあたりを調べて押させえよう。
$ git init
$ git add
$ git remote
$ git push
$ git commit
$ git pull
$ git checkout
$ git fetch
$ git rebase
$ git merge

2章で再度リモートリポジトリでpushできなくて、苦戦中
再度、appつくりなおし。

pull = fetch + merge origin/masterの理解が必要

master と origin/master
参考https://qiita.com/osamu1203/items/cb94ef9da02e1ec3e921

スクリーンショット 2018-10-19 19.26.24.png

non-fast-forwardについて

2.2.1完了 2018/10/19
rails generate でUsersを作成した。

2.2.2

rubyについての予備知識

@hogehogeはインスタンス変数(クラスの中で扱う変数のことです。)
通常の変数は(ローカル変数)の宣言は、特に宣言なく
hogehoge = 1とかでいけます。

defはメソッドの定義のときに利用します。

def hogehoge
  puts "hogehogehogehoge"
end

といった感じ。

resorce:users
→: シンボル(文字列の皮を被った数値)

図で整理しました。

スクリーンショット 2018-10-19 21.24.10.png

2.3~

has_many:micropost
belongs_to:user

validates: XXXXX,prsence:true
とか

一旦は2章で完了しました。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0