LoginSignup
4
4

More than 5 years have passed since last update.

Railsチュートリアルつまづいた箇所

Last updated at Posted at 2015-08-23

2015/8よりRailsチュートリアルをGemバージョン指定せず進めたときのつまづいた箇所備忘録。
随時更新していきます。

(つまづき1)Capybara DSLをRSpecヘルパーファイルに追加する。
 × spec/spec_helper.rb に記載
 ○ spec/rails_helper.rb  に記載
 ➡理由 Rspecのバージョン違い
(参考) RSpec3でCapybaraのinclude
http://qiita.com/necojackarc/items/8ba3a3fd2262f69adc34

(つまづき2)sporkを介したrspecでエラー
 以下の記事の通りにしたら動いた。
  (参考)RSpecとsportkの連携時のエラー
  http://toifan.daiwa-hotcom.com/wordpress/?p=271
 ➡理由 Rspec3からRSpec::Core::CommandLineがなくなったらしい

(つまづき3)画面がくずれる
  ・header内のulたぐにnav-tabs追加
   元々 <ul class="nav pull-right">
   修正 <ul class="nav nav-tabs pull-right">

  ・hero-unitが効かない➡そのままそっとしておく

(つまづき4)bootstrap LESSの変数
Bootstrap2と3でのカラー変数の違い
http://qiita.com/necojackarc/items/9e549746252f44ce6680

(つまづき5)Rspecのbe_falseマッチャのリネーム
be_true/be_falseマッチャが、be_truthy/be_falsey(またはbe_falsy)にリネームされているのでbe_falsyに直す必要がある。

(つまづき6)uninitialized constant FactoryGirl
 以下の通りにしたら解消
(参考)【エラー】uninitialized constant FactoryGirl と出る場合
http://source.hatenadiary.jp/entry/2014/02/06/222318

(つまづき7)bootstrap のエラースタイルが適用されない
 以下の通りで解決
(参考)Railsのfield_with_errorsクラスにBootstrap3を適用
http://qiita.com/necojackarc/items/12abfa22bf767da20096

(つまづき8)bootstrap alert-errorが赤くならない
 以下の通りで解決
(参考).alert.alert-errorがスタイルされない
http://qiita.com/yoshiyukiohta@github/items/1b7c35b45cda5628d211

(気づき)
  it { should ... } より
  it { is_expected ... } と書いた方がよいらしい

(つまづき9)alert[:notice]の色がつかない
 またしてもbootstrapの変更 notice ➡ alert-info
(参考)
https://gist.github.com/suryart/7418454

4
4
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
4
4