質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

1回答

7661閲覧

stylesheet_link_tag がエラーになる

ryuji.morimoto

総合スコア10

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2016/11/29 07:19

編集2016/12/01 09:27

Ruby on Railsの勉強をしています。
要約開発環境の構築ができたのですが、
実際に表示させると下記のエラーが表示されることが
わかりました。

イメージ説明

初心者のため、何が原因でエラーが起きているかわからず、
困っています。

対策方法はどのようにすればよろしいでしょうか?

また、対策を検討するにあたり何の情報を提供すれば良いかも
わかっていないので、必要な情報があればご教授いただけますと幸いです。

よろしくお願いします。

ーーーーーーーーーーーーーーーーーーーーーーーーーー
バージョン情報
Ruby 2.2.5
Rails 5.0.0.1

エラー内容表示
コマンド >rails s
localhost:3000を開くと、下記のようなエラーが表示されます。

C:\RubyWork\gatebook>rails

1Your bundle is locked to rails (5.0.0.1), but that version could not be found in 2 any of the sources listed in your Gemfile. If you haven't changed sources, that 3 means the author of rails (5.0.0.1) has removed it. You'll need to update your 4bundle to a different version of rails (5.0.0.1) that hasn't been removed in ord 5er to install. 6Run `bundle install` to install missing gems. 7 8C:\RubyWork\gatebook> gem install rails --version="~> 4.2.3" --no-ri --no-rdoc 9Successfully installed rails-4.2.7.1 101 gem installed 11 12C:\RubyWork\gatebook>rails -v 13Could not find gem 'rails (>= 5.0.0.1, ~> 5.0.0) x64-mingw32' in any of the gem 14sources listed in your Gemfile or available on this machine. 15Run `bundle install` to install missing gems. 16 17C:\RubyWork\gatebook>bundle install 18Fetching gem metadata from https://rubygems.org/.......... 19Fetching version metadata from https://rubygems.org/.. 20Fetching dependency metadata from https://rubygems.org/. 21Resolving dependencies... 22Bundler could not find compatible versions for gem "activemodel": 23 In snapshot (Gemfile.lock): 24 activemodel (= 4.2.7.1) 25 26 In Gemfile: 27rails (>= 5.0.0.1, ~> 5.0.0) x64-mingw32 was resolved to 5.0.0.1, which 28depends on 29 activemodel (= 5.0.0.1) x64-mingw32 30 31rails (>= 5.0.0.1, ~> 5.0.0) x64-mingw32 was resolved to 5.0.0.1, which 32depends on 33 activemodel (= 5.0.0.1) x64-mingw32 34 35 web-console x64-mingw32 was resolved to 3.4.0, which depends on 36 activemodel (>= 5.0) x64-mingw32 37 38Running `bundle update` will rebuild your snapshot from scratch, using only 39the gems in your Gemfile, which may resolve the conflict. 40 41C:\RubyWork\gatebook>rails -v 42Could not find gem 'rails (>= 5.0.0.1, ~> 5.0.0) x64-mingw32' in any of the gem 43sources listed in your Gemfile or available on this machine. 44Run `bundle install` to install missing gems. 45 46C:\RubyWork\gatebook>bundle update 47Fetching gem metadata from https://rubygems.org/.......... 48Fetching version metadata from https://rubygems.org/.. 49Fetching dependency metadata from https://rubygems.org/. 50Resolving dependencies... 51Using rake 11.3.0 52Using concurrent-ruby 1.0.2 53Using i18n 0.7.0 54Using minitest 5.10.0 55Using thread_safe 0.3.5 56Using builder 3.2.2 57Using erubis 2.7.0 58Using mini_portile2 2.1.0 59Using rack 2.0.1 60Using nio4r 1.2.1 61Using websocket-extensions 0.1.2 62Using mime-types-data 3.2016.0521 63Using arel 7.1.4 64Using bundler 1.13.6 65Using coffee-script-source 1.11.1 66Using execjs 2.7.0 67Using method_source 0.8.2 68Using thor 0.19.4 69Using debug_inspector 0.0.2 70Using multi_json 1.12.1 71Using json 2.0.2 72Using puma 3.6.2 73Using sass 3.4.22 74Using tilt 2.0.5 75Using temple 0.7.7 76Using sqlite3 1.3.12 77Using turbolinks-source 5.0.0 78Using tzinfo 1.2.2 79Using nokogiri 1.6.8.1 80Using rack-test 0.6.3 81Using sprockets 3.7.0 82Using websocket-driver 0.6.4 83Using mime-types 3.1 84Using coffee-script 2.4.1 85Using uglifier 2.7.1 86Using slim 3.0.0 87Using turbolinks 5.0.1 88Using activesupport 5.0.0.1 (was 4.2.7.1) 89Using tzinfo-data 1.2016.10 90Using loofah 2.0.3 91Using mail 2.6.4 92Using rails-dom-testing 2.0.1 93Using globalid 0.3.7 94Using activemodel 5.0.0.1 (was 4.2.7.1) 95Using jbuilder 2.6.1 96Using rails-html-sanitizer 1.0.3 97Using activejob 5.0.0.1 (was 4.2.7.1) 98Using activerecord 5.0.0.1 (was 4.2.7.1) 99Using actionview 5.0.0.1 (was 4.2.7.1) 100Using actionpack 5.0.0.1 (was 4.2.7.1) 101Using actioncable 5.0.0.1 (was 4.2.7.1) 102Using actionmailer 5.0.0.1 (was 4.2.7.1) 103Using railties 5.0.0.1 (was 4.2.7.1) 104Using sprockets-rails 3.2.0 105Using coffee-rails 4.2.1 106Using jquery-rails 4.2.1 107Using web-console 3.4.0 108Installing rails 5.0.0.1 (was 4.2.7.1) 109Using sass-rails 5.0.6 110Bundle updated! 111 112C:\RubyWork\gatebook> 113C:\RubyWork\gatebook>rails -v 114Rails 5.0.0.1 115 116C:\RubyWork\gatebook>rails s 117=> Booting Puma 118=> Rails 5.0.0.1 application starting in development on http://localhost:3000 119=> Run `rails server -h` for more startup options 120*** SIGUSR2 not implemented, signal based restart unavailable! 121*** SIGUSR1 not implemented, signal based restart unavailable! 122*** SIGHUP not implemented, signal based logs reopening unavailable! 123Puma starting in single mode... 124* Version 3.6.2 (ruby 2.2.5-p319), codename: Sleepy Sunday Serenity 125* Min threads: 5, max threads: 5 126* Environment: development 127* Listening on tcp://localhost:3000 128Use Ctrl-C to stop 129Started GET "/" for ::1 at 2016-12-01 18:22:09 +0900 130Started GET "/" for ::1 at 2016-12-01 18:22:10 +0900 131 ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM 132"schema_migrations" 133 ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM 134"schema_migrations" 135Processing by HomeController#top as HTML 136Processing by HomeController#top as HTML 137 Rendering home/top.html.erb within layouts/application 138 Rendering home/top.html.erb within layouts/application 139 Rendered home/top.html.erb within layouts/application (5.0ms) 140 Rendered home/top.html.erb within layouts/application (2.5ms) 141Completed 500 Internal Server Error in 398ms (ActiveRecord: 0.0ms) 142 143 144 145ActionView::Template::Error (Permission denied @ utime_failed - C:/RubyWork/gate 146book/tmp/cache/assets/sprockets/v3.0/2B/2BLEsUhwGIsUvJQ37HFD_Hf9qHpr1OHl2YeZ8X16 147uzA.cache): 148 3: <head> 149 4: <title>Gatebook</title> 150 5: <%= csrf_meta_tags %> 151 6: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolin 152ks-track' => true %> 153 7: <%= javascript_include_tag 'application', 'data-turbolinks-track' => t 154rue %> 155 8: <style>/* 共通レイアウト ================================ */ 156 9: body { 157 158app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html 159_erb__2079029030_63889060' 160 Rendering C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action 161_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/la 162yout 163 Rendering C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action 164_dispatch/middleware/templates/rescues/_source.html.erb 165 Rendered C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_ 166dispatch/middleware/templates/rescues/_source.html.erb (7.5ms) 167 Rendering C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action 168_dispatch/middleware/templates/rescues/_trace.html.erb 169 Rendered C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_ 170dispatch/middleware/templates/rescues/_trace.html.erb (5.0ms) 171Completed 500 Internal Server Error in 2170ms (ActiveRecord: 0.0ms) 172 173 174 Rendering C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action 175_dispatch/middleware/templates/rescues/_request_and_response.html.erb 176 177 Rendered C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_ 178dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.0ms) 179ActionView::Template::Error (TypeError: オブジェクトでサポートされていないプロパ 180ティまたはメソッドです。): 181 Rendered C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_ 182dispatch/middleware/templates/rescues/template_error.html.erb within rescues/lay 183out (1052.5ms) 184 3: <head> 185 4: <title>Gatebook</title> 186 5: <%= csrf_meta_tags %> 187 6: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolin 188ks-track' => true %> 189 7: <%= javascript_include_tag 'application', 'data-turbolinks-track' => t 190rue %> 191 8: <style>/* 共通レイアウト ================================ */ 192 9: body { 193 194app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html 195_erb__2079029030_63889060' 196 Rendering C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action 197_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/la 198yout 199 Rendering C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action 200_dispatch/middleware/templates/rescues/_source.html.erb 201 Rendered C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_ 202dispatch/middleware/templates/rescues/_source.html.erb (7.5ms) 203 Rendering C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action 204_dispatch/middleware/templates/rescues/_trace.html.erb 205 Rendered C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_ 206dispatch/middleware/templates/rescues/_trace.html.erb (2.5ms) 207 Rendering C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action 208_dispatch/middleware/templates/rescues/_request_and_response.html.erb 209 Rendered C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_ 210dispatch/middleware/templates/rescues/_request_and_response.html.erb (2.5ms) 211 Rendered C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionpack-5.0.0.1/lib/action_ 212dispatch/middleware/templates/rescues/template_error.html.erb within rescues/lay 213out (942.5ms) 214

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

kusanagi

2016/11/29 09:57

ログは画像でなくテキストで全文載せてください。ここにくるまでのコマンド入力もできれば。
ryuji.morimoto

2016/12/01 09:27

コメントありがとうございます。コマンドとエラー内容を追記いたしました。
guest

回答1

0

ActionView::Template::Error (Permission denied @ utime_failed - C:/RubyWork/gate

book/tmp/cache/assets/sprockets/v3.0/2B/2BLEsUhwGIsUvJQ37HFD_Hf9qHpr1OHl2YeZ8X16
uzA.cache):

この部分ですかね。該当するファイルのパーミッションがおかしいのかな。
Windows環境でRailsを動かした時の問題の一つでしょうか。
ちなみにファイルのパーミッションはどうなってますでしょうか。

以下のコマンドを試してみてください。
bin/rails tmp:cache:clear
bin/rails assets:precompile

もしくは、tmpフォルダ以下を一度削除してから実行するとか。(やや乱暴か?)

以下のURLを参考になるかもしれません。
http://stackoverflow.com/questions/7524262/permission-denied-in-tmp

投稿2016/12/02 02:30

編集2016/12/02 02:40
kusanagi

総合スコア52

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

ryuji.morimoto

2016/12/06 02:21

上記コマンドを実行してみましたが、うまく動作しませんでした。。 ガチャガチャといじっていたのですが、 どうにもうまく動作せず。。 一旦、ヘルパーの使用をやめて学習を続けたいと思います。
takumi123

2016/12/31 23:02

もう解決されたかもしれませんが、Windowsではディレクトリのプロパティからフルコントロールを与えてやればうまくいきました
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問