konchanxxx / menta

MENTAのタスク管理用リポジトリ
0 stars 0 forks source link

:が認識されないです。 #39

Closed RYUTAONO0929 closed 5 years ago

RYUTAONO0929 commented 5 years ago

概要

:を認識してくれないです。

実現したいこと

3-3-1-5 p106

困っていること

SyntaxError in TasksController#newが発生して先に進めない

10

困っていることがバグの場合は事象やログ、エラーメッセージをできるだけそのまま(抜粋などしない)下記に記載してください。

/home/ryutaono/taskleaf/app/views/tasks/new.html.slim:10: syntax error, unexpected ':' ...tils.escape_html_safe((f.label: name))).to_s)); ... ^

8 9 10 11 12 13 = form_with model: @task, local: true do \ f\ .form-group = f.label: name = f.text_field :name, class: 'form-control', id: 'task_name' .form-group =f.label :description

Rails.root: /home/ryutaono/taskleaf

Application Trace | Framework Trace | Full Trace app/views/tasks/new.html.slim:10: syntax error, unexpected ':' ```

解決するために行ったこと

調べたところ、ymlファイルに:を付け忘れると発生するエラーのようなのですが、直前に開いたja.ymlには異常が見当たりませんでした。

問題となっている箇所の予想

ja.ymlファイルです。


ja: activerecord: errors: messages: record_invalid: 'バリデーションに失敗しました: %{errors}' restrict_dependent_destroy: has_one: "%{record}が存在しているので削除できません" has_many: "%{record}が存在しているので削除できません" models: task: タスク attributes: task: id: ID name: 名称 description: 詳しい説明 created_at: 登録日時 updated_at: 更新日時

abbr_day_names:
- 日
- 月
- 火
- 水
- 木
- 金
- 土
abbr_month_names:
-
- 1月
- 2月
- 3月
- 4月
- 5月
- 6月
- 7月
- 8月
- 9月
- 10月
- 11月
- 12月
day_names:
- 日曜日
- 月曜日
- 火曜日
- 水曜日
- 木曜日
- 金曜日
- 土曜日
formats:
  default: "%Y/%m/%d"
  long: "%Y年%m月%d日(%a)"
  short: "%m/%d"
month_names:
-
- 1月
- 2月
- 3月
- 4月
- 5月
- 6月
- 7月
- 8月
- 9月
- 10月
- 11月
- 12月
order:
- :year
- :month
- :day

datetime: distance_in_words: about_x_hours: one: 約1時間 other: 約%{count}時間 about_x_months: one: 約1ヶ月 other: 約%{count}ヶ月 about_x_years: one: 約1年 other: 約%{count}年 almost_x_years: one: 1年弱 other: "%{count}年弱" half_a_minute: 30秒前後 less_than_x_seconds: one: 1秒以内 other: "%{count}秒未満" less_than_x_minutes: one: 1分以内 other: "%{count}分未満" over_x_years: one: 1年以上 other: "%{count}年以上" x_seconds: one: 1秒 other: "%{count}秒" x_minutes: one: 1分 other: "%{count}分" x_days: one: 1日 other: "%{count}日" x_months: one: 1ヶ月 other: "%{count}ヶ月" x_years: one: 1年 other: "%{count}年" prompts: second: 秒 minute: 分 hour: 時 day: 日 month: 月 year: 年 errors: format: "%{attribute}%{message}" messages: accepted: を受諾してください blank: を入力してください confirmation: と%{attribute}の入力が一致しません empty: を入力してください equal_to: は%{count}にしてください even: は偶数にしてください exclusion: は予約されています greater_than: は%{count}より大きい値にしてください greater_than_or_equal_to: は%{count}以上の値にしてください inclusion: は一覧にありません invalid: は不正な値です less_than: は%{count}より小さい値にしてください less_than_or_equal_to: は%{count}以下の値にしてください model_invalid: 'バリデーションに失敗しました: %{errors}' not_a_number: は数値で入力してください not_an_integer: は整数で入力してください odd: は奇数にしてください other_than: は%{count}以外の値にしてください present: は入力しないでください required: を入力してください taken: はすでに存在します too_long: は%{count}文字以内で入力してください too_short: は%{count}文字以上で入力してください wrong_length: は%{count}文字で入力してください template: body: 次の項目を確認してください header: one: "%{model}にエラーが発生しました" other: "%{model}に%{count}個のエラーが発生しました" helpers: select: prompt: 選択してください submit: create: 登録する submit: 保存する update: 更新する number: currency: format: delimiter: "," format: "%n%u" precision: 0 separator: "." significant: false strip_insignificant_zeros: false unit: 円 format: delimiter: "," precision: 3 separator: "." significant: false strip_insignificant_zeros: false human: decimal_units: format: "%n %u" units: billion: 十億 million: 百万 quadrillion: 千兆 thousand: 千 trillion: 兆 unit: '' format: delimiter: '' precision: 3 significant: true strip_insignificant_zeros: true storage_units: format: "%n%u" units: byte: バイト eb: EB gb: GB kb: KB mb: MB pb: PB tb: TB percentage: format: delimiter: '' format: "%n%" precision: format: delimiter: '' support: array: last_word_connector: "、" two_words_connector: "、" words_connector: "、" time: am: 午前 formats: default: "%Y年%m月%d日(%a) %H時%M分%S秒 %z" long: "%Y/%m/%d %H:%M" short: "%m/%d %H:%M" pm: 午後

問題となっているアプリケーションのGitHub URL

konchanxxx commented 5 years ago

@RYUTAONO0929

/home/ryutaono/taskleaf/app/views/tasks/new.html.slim:10: syntax error, unexpected ':'

の部分はどう解釈しましたか?

RYUTAONO0929 commented 5 years ago

issueの件了解です。勝手にcloseしてしまい申し訳ありませんでした。

構文の問題のエラーのように思います。 new.htmlに含まれる:を文字として認識していないのでしょうか? 調べたところ、言語の設定ファイルである、ymlファイルに:が読み込まれていないと、このようなエラーがでることがわかりました。

konchanxxx commented 5 years ago

/home/ryutaono/taskleaf/app/views/tasks/new.html.slim

というファイルの

10 行目に

syntax error 構文エラー

unexpected ':' 期待していないコロンが存在するとなっているので

new.html.slim の10行目に誤りが存在するはずです。ymlは関係ないです:bow:

konchanxxx commented 5 years ago

該当箇所が誤っていないかもう一度確認をお願いします:bow:

RYUTAONO0929 commented 5 years ago

/home/ryutaono/taskleaf/app/views/tasks/new.html.slimを3-3-1-5 p104で確認したところ間違った点はありませんでした。 new.html.slimです。

h1 Tasks#new
p Find me in app/views/tasks/new.html.slim

h1 タスクの新規登録
.nav.justify-content-end
 = link_to '一覧', tasks_path, class: 'nav-link'

 = form_with model : @task, local: true do |f|
  .form-group
    = f.label :name
    = f.text_field :name, class: 'form-control', id: 'task_name'
  .form-group
    =f.label :description
    =f.text_area :description, rows: 5, class: 'form-control', id: 'task_description'
  =f.submit nil, class: 'btn btn-primary'

その後もう一度rails sでサーバーを起動したところ、今度はパーミッションのエラーが出ました。

Errno::EACCES in TasksController#new
Permission denied @ rb_sysopen - /home/ryutaono/taskleaf/app/views/tasks/new.html.slim
229 230 231 232 233 234 template_paths.map do \ template\ handler, format, variant = extract_handler_and_format_and_variant(template) contents = File.binread(template) Template.new(contents, File.expand_path(template), handler, virtual_path: path.virtual,

Rails.root: /home/ryutaono/taskleaf

Application Trace | Framework Trace | Full Trace
vendor/bundle/ruby/2.5.0/gems/actionview-5.2.2/lib/action_view/template/resolver.rb:231:in `binread'
vendor/bundle/ruby/2.5.0/gems/actionview-5.2.2/lib/action_view/template/resolver.rb:231:in `block in query'
vendor/bundle/ruby/2.5.0/gems/actionview-5.2.2/lib/action_view/template/resolver.rb:229:in `map'
vendor/bundle/ruby/2.5.0/gems/actionview-5.2.2/lib/action_view/template/resolver.rb:229:in `query'
vendor/bundle/ruby/2.5.0/gems/actionview-5.2.2/lib/action_view/template/resolver.rb:220:in `find_templates'
vendor/bundle/ruby/2.5.0/gems/actionview-5.2.2/lib/action_view/template/resolver.rb:147:in `block in find_all'
vendor/bundle/ruby/2.5.0/gems/actionview-5.2.2/lib/action_view/template/resolver.rb:187:in `block in cached'
vendor/bundle/ruby/2.5.0/gems/actionview-5.2.2/lib/action_view/template/resolver.rb:69:in `cache'
vendor/bundle/ruby/2.5.0/gems/actionview-5.2.2/lib/action_view/template/resolver.rb:186:in `cached'
vendor/bundle/ruby/2.5.0/gems/actionview-5.2.2/lib/action_view/template/resolver.rb:146:in `find_all'
vendor/bundle/ruby/2.5.0/gems/actionview-5.2.2/lib/action_view/path_set.rb:81:in `block (2 levels) in _find_all'
vendor/bundle/ruby/2.5.0/gems/actionview-5.2.2/lib/action_view/path_set.rb:77:in `each'
vendor/bundle/ruby/2.5.0/gems/actionview-5.2.2/lib/action_view/path_set.rb:77:in `block in _find_all'
vendor/bundle/ruby/2.5.0/gems/actionview-5.2.2/lib/action_view/path_set.rb:76:in `each'
vendor/bundle/ruby/2.5.0/gems/actionview-5.2.2/lib/action_view/path_set.rb:76:in `_find_all'
vendor/bundle/ruby/2.5.0/gems/actionview-5.2.2/lib/action_view/path_set.rb:56:in `find_all'
vendor/bundle/ruby/2.5.0/gems/actionview-5.2.2/lib/action_view/path_set.rb:60:in `exists?'
vendor/bundle/ruby/2.5.0/gems/actionview-5.2.2/lib/action_view/lookup_context.rb:129:in `exists?'
vendor/bundle/ruby/2.5.0/gems/actionview-5.2.2/lib/action_view/view_paths.rb:11:in `template_exists?'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_controller/metal/implicit_render.rb:34:in `default_render'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_controller/metal/basic_implicit_render.rb:6:in `block in send_action'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_controller/metal/basic_implicit_render.rb:6:in `tap'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/abstract_controller/base.rb:194:in `process_action'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_controller/metal/rendering.rb:30:in `process_action'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:132:in `run_callbacks'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/abstract_controller/callbacks.rb:41:in `process_action'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_controller/metal/rescue.rb:22:in `process_action'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/notifications.rb:168:in `block in instrument'
vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/notifications.rb:168:in `instrument'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_controller/metal/instrumentation.rb:32:in `process_action'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_controller/metal/params_wrapper.rb:256:in `process_action'
vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/railties/controller_runtime.rb:24:in `process_action'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/abstract_controller/base.rb:134:in `process'
vendor/bundle/ruby/2.5.0/gems/actionview-5.2.2/lib/action_view/rendering.rb:32:in `process'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_controller/metal.rb:191:in `dispatch'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_controller/metal.rb:252:in `dispatch'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/routing/route_set.rb:52:in `dispatch'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/routing/route_set.rb:34:in `serve'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/journey/router.rb:52:in `block in serve'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/journey/router.rb:35:in `each'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/journey/router.rb:35:in `serve'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/routing/route_set.rb:840:in `call'
vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/tempfile_reaper.rb:15:in `call'
vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/etag.rb:25:in `call'
vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/conditional_get.rb:25:in `call'
vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/head.rb:12:in `call'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/http/content_security_policy.rb:18:in `call'
vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/session/abstract/id.rb:232:in `context'
vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/session/abstract/id.rb:226:in `call'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/cookies.rb:670:in `call'
vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:559:in `call'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:98:in `run_callbacks'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/executor.rb:14:in `call'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'
vendor/bundle/ruby/2.5.0/gems/web-console-3.7.0/lib/web_console/middleware.rb:135:in `call_app'
vendor/bundle/ruby/2.5.0/gems/web-console-3.7.0/lib/web_console/middleware.rb:30:in `block in call'
vendor/bundle/ruby/2.5.0/gems/web-console-3.7.0/lib/web_console/middleware.rb:20:in `catch'
vendor/bundle/ruby/2.5.0/gems/web-console-3.7.0/lib/web_console/middleware.rb:20:in `call'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/rack/logger.rb:38:in `call_app'
vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/rack/logger.rb:26:in `block in call'
vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/tagged_logging.rb:71:in `block in tagged'
vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/tagged_logging.rb:28:in `tagged'
vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/tagged_logging.rb:71:in `tagged'
vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/rack/logger.rb:26:in `call'
vendor/bundle/ruby/2.5.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/quiet_assets.rb:13:in `call'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/request_id.rb:27:in `call'
vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/method_override.rb:22:in `call'
vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/runtime.rb:22:in `call'
vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/executor.rb:14:in `call'
vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/static.rb:127:in `call'
vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/sendfile.rb:111:in `call'
vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/engine.rb:524:in `call'
vendor/bundle/ruby/2.5.0/gems/puma-3.12.0/lib/puma/configuration.rb:225:in `call'
vendor/bundle/ruby/2.5.0/gems/puma-3.12.0/lib/puma/server.rb:658:in `handle_request'
vendor/bundle/ruby/2.5.0/gems/puma-3.12.0/lib/puma/server.rb:472:in `process_client'
vendor/bundle/ruby/2.5.0/gems/puma-3.12.0/lib/puma/server.rb:332:in `block in run'
vendor/bundle/ruby/2.5.0/gems/puma-3.12.0/lib/puma/thread_pool.rb:133:in `block in spawn_thread'
RYUTAONO0929 commented 5 years ago

パーミッションのエラーがしばしば出てくるので対策方法を御指導お願い致します。

konchanxxx commented 5 years ago

/home/ryutaono/taskleaf/app/views/tasks/new.html.slimを3-3-1-5 p104で確認したところ間違った点はありませんでした。 new.html.slimです。

いや、添付のエラー画像のスクショ見ると

= f.label: name

になっていてlの後にコロンがあるのでそれが原因だったと思います。今は修正されているようですが。

konchanxxx commented 5 years ago

ファイルってどうやって作成していますか? ファイル作成時にpermissionが変わるような操作をしていそうです。 まずはls -laコマンドでtaskleafの情報を出力してみてください:bow:

RYUTAONO0929 commented 5 years ago

= f.label: name: name を= f.label : nameにしなければならなかったということでしょうか? :が余計に入力されているのでエラーが出ているのだと勘違いしていました。申し訳ありません。

ls -laの結果はこのようになっています。

ryutaono@DESKTOP-G6D20US:~/taskleaf$ ls -la
total 16
drwxr-xr-x 1 ryutaono ryutaono 4096 Feb 17 13:38 .
drwxr-xr-x 1 ryutaono ryutaono 4096 Feb 16 17:12 ..
drwxr-xr-x 1 ryutaono ryutaono 4096 Feb 17 13:38 .bundle
drwxr-xr-x 1 ryutaono ryutaono 4096 Feb 16 17:12 .git
-rwxr-xr-x 1 ryutaono ryutaono  620 Feb 16 17:12 .gitignore
-rwxr-xr-x 1 ryutaono ryutaono    5 Feb 16 17:12 .ruby-version
-rwxr-xr-x 1 ryutaono ryutaono 2265 Feb 18 09:34 Gemfile
-rwxr-xr-x 1 ryutaono ryutaono 5821 Feb 18 09:34 Gemfile.lock
-rwxr-xr-x 1 ryutaono ryutaono  374 Feb 16 17:12 README.md
-rwxr-xr-x 1 ryutaono ryutaono  227 Feb 16 17:12 Rakefile
drwxr-xr-x 1 ryutaono ryutaono 4096 Feb 16 17:12 app
drwxr-xr-x 1 ryutaono ryutaono 4096 Feb 16 17:12 bin
drwxr-xr-x 1 ryutaono ryutaono 4096 Feb 16 17:12 config
-rwxr-xr-x 1 ryutaono ryutaono  130 Feb 16 17:12 config.ru
drwxr-xr-x 1 ryutaono ryutaono 4096 Feb 23 14:46 db
drwxr-xr-x 1 ryutaono ryutaono 4096 Feb 16 17:12 lib
drwxr-xr-x 1 ryutaono ryutaono 4096 Feb 16 17:14 log
-rwxr-xr-x 1 ryutaono ryutaono   66 Feb 16 17:12 package.json
drwxr-xr-x 1 ryutaono ryutaono 4096 Feb 16 17:12 public
drwxr-xr-x 1 ryutaono ryutaono 4096 Feb 16 17:12 storage
drwxr-xr-x 1 ryutaono ryutaono 4096 Feb 16 17:12 test
drwxr-xr-x 1 ryutaono ryutaono 4096 Feb 16 17:14 tmp
drwxr-xr-x 1 ryutaono ryutaono 4096 Feb 17 14:03 vendor

ファイル作成は3-1-3 rails new taskleaf -d postgresql 3-2-2 bin/rails g model Task name:string description:text 3-3 bin/rails g controller tasks index show new edit

のようにして作成しました。

konchanxxx commented 5 years ago

= f.label: name: name を= f.label : nameにしなければならなかったということでしょうか?

ですです。 :name というのがシンボルという変数なのでそのことは覚えておいた方が良いと思います:bow: https://uxmilk.jp/25934

ls -la /home/ryutaono/taskleaf/app/views/tasks/new.html.slim

はどうなりますか?

ls というコマンドがディレクトリやファイルの情報を出力するコマンドなのでそこで権限周りを確認することができます。 drwxr-xr-x の部分が書き込み読み込みの権限などを表しています。 https://kazmax.zpp.jp/linux_beginner/permission_numerical.html

そのため

/home/ryutaono/taskleaf/app/views/tasks/new.html.slim

ファイルの権限を確認して権限がない場合は変更してやれば良いかなと思いました。

権限変更は chmod と言うコマンドで実行することができます。

https://eng-entrance.com/linux-command-chmod

そんなに変なコマンド使ってなさそうですね。なんでだろう??

ls -la  /home/ryutaono/taskleaf/app/views/tasks

も実行お願いします

RYUTAONO0929 commented 5 years ago
ryutaono@DESKTOP-G6D20US:~$ cd taskleaf
ryutaono@DESKTOP-G6D20US:~/taskleaf$ ls -la /home/ryutaono/taskleaf/app/views/tasks/new.html.slim
---------- 1 ryutaono ryutaono 476 Feb 25 15:01 /home/ryutaono/taskleaf/app/views/tasks/new.html.slim
ryutaono@DESKTOP-G6D20US:~/taskleaf$ ls -la  /home/ryutaono/taskleaf/app/views/tasks
total 4
drwxr-xr-x 1 ryutaono ryutaono 4096 Feb 21 17:28 .
drwxr-xr-x 1 ryutaono ryutaono 4096 Feb 21 17:28 ..
-rwxr-xr-x 1 ryutaono ryutaono   58 Feb 21 17:28 edit.html.slim
-rwxr-xr-x 1 ryutaono ryutaono  147 Feb 21 17:28 index.html.slim
---------- 1 ryutaono ryutaono  476 Feb 25 15:01 new.html.slim
-rwxr-xr-x 1 ryutaono ryutaono   58 Feb 21 17:28 show.html.slim
ryutaono@DESKTOP-G6D20US:~/taskleaf$

new.htmlだけが権限を持っていない・・・・・なぜでしょうか?

chomd 777 new.html.slim

で権限を変更すればOKですか?

konchanxxx commented 5 years ago

本当ですね。 普段ファイルの編集とかは何のエディタ使ってますか? 他のファイルは生成時間が17:28で自動生成したままでnewのファイルだけ更新されていて権限が異なるようなのでファイル編集を何でやっているかなどが気になりました。

777は誰でも処理実行できる状態でちょっとセキュリティ的に危ないので755とかが良いと思います。 http://www.tohoho-web.com/wwwxx012.htm

RYUTAONO0929 commented 5 years ago

エディタはAtomを使っています。 chmodコマンドでnew.html.slimの権限を変更したところ、今度はja.ymlに権限がない(----)とでてきたのでそれもchmodで権限変更したところ解決しました。 権限変更の仕方は覚えたので次回からは自分で対応できそうです。 ありがとうございました。

konchanxxx commented 5 years ago

エディタはAtomを使っています。

おお、そうなんですね。じゃあ普通に大丈夫な気がしますね。。

とはいえ原因があるはずなのでファイルを作成した時や変更した時に権限が変わっている?と思われるので作業する時に権限を確認してどういう時に権限が変わっているか調査してみると良いかもしれません。 通常は権限は変わらないので。。

このissueは閉じておきますね:bow: