LoginSignup
15
7

More than 3 years have passed since last update.

Ruby on Rails チュートリアル Windows での実施時の困ったメモ

Last updated at Posted at 2020-06-06

Ruby on Rails チュートリアル:実例を使って Rails を学ぼう を Windows で実行している時に困ったことのメモをまとめていきます。

第3章にて成功するはずのテストが失敗する

3.3.1 最初のテストでGET が成功するか見るだけのテストなのに Permission エラーで失敗

E

Error:
StaticPagesControllerTest#test_should_get_help:
ActionView::Template::Error: Permission denied @ rb_file_s_rename - (C:/environment/sample_app/tmp/cache/assets/sprockets/v4.0.0/99/99m8UCKl4j8IpsVOK8ltLHyNh8Ae0nHw3GBkC34V_co.cache.68827840.15592.375890, C:/environment/sample_app/tmp/cache/assets/sprockets/v4.0.0/99/99m8UCKl4j8IpsVOK8ltLHyNh8Ae0nHw3GBkC34V_co.cache)
    app/views/layouts/application.html.erb:8
    test/controllers/static_pages_controller_test.rb:10:in `block in <class:StaticPagesControllerTest>'


rails test test/controllers/static_pages_controller_test.rb:9

.

Finished in 0.474810s, 4.2122 runs/s, 2.1061 assertions/s.
2 runs, 1 assertions, 0 failures, 1 errors, 0 skips

Ruby on Rails - stylesheet_link_tag がエラーになる|teratail を参考に以下のコマンドを実行したら、解消した。

> rails tmp:cache:clear
> rails assets:precompile

Guard を実行すると警告が表示される

  Please add the following to your Gemfile to avoid polling for changes:
    gem 'wdm', '>= 0.1.0' if Gem.win_platform?

書かれている通り、Gemfile に

gem 'wdm', '>= 0.1.0', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

を追加して、

bundle install --without=production

を実行してから、Guard を再起動した。

bundle exec guard

ちなみに wdm は、Windows Directory Monitor の略のようです。

参考リンク

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