teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

3

タイトル変更

2020/12/13 07:24

投稿

renren
renren

スコア48

title CHANGED
@@ -1,1 +1,1 @@
1
- herokuにデプロイできません
1
+ herokuにデプロイできません(NoMethodError)
body CHANGED
@@ -18,7 +18,6 @@
18
18
  →git push heroku develop:main
19
19
  どちらも同じエラーが出てデプロイできませんでした...
20
20
 
21
-
22
21
  お手数おかけしますが、何卒よろしくお願いいたします。
23
22
 
24
23
  ■エラーメッセージ(git push heroku master後)

2

改善するうちに、コード、エラー内容が変わったため

2020/12/13 07:24

投稿

renren
renren

スコア48

title CHANGED
@@ -1,1 +1,1 @@
1
- すでにデプロイ済みと言われてpushできません
1
+ herokuにデプロイできません
body CHANGED
@@ -1,13 +1,7 @@
1
- 閲覧ありがとうございます
1
+ herokuにデプロイできず詰まっています
2
2
 
3
- 色々と調べてたのですが、解決できなかったので質問させてください。
4
-
5
- 現在、実務未経験で転職活動のため、Railsにてオリジナルアプリを開発中なのですがherokuにデプロイできず詰まっています...
6
-
7
3
  自分で色々と調べ、試したのですが解決せずどの様に解決したらいいのか分かりません...
8
4
 
9
- 何卒、よろしくお願いいたします!!!
10
-
11
5
  現状は下記の通りです。
12
6
 
13
7
  ■スペック
@@ -15,9 +9,6 @@
15
9
  ・Rails 6.0.3.4
16
10
  ・ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-darwin19]
17
11
 
18
- ■原因だと考えていること
19
- ・heroku logsにて確認したところ、ビルドが失敗しております。
20
- ・エラーメッセージにてすでにデプロイ済みですと警告が出ています。
21
12
 
22
13
  ■試したこと
23
14
  ・コミットしていることを確認。
@@ -32,34 +23,99 @@
32
23
 
33
24
  ■エラーメッセージ(git push heroku master後)
34
25
  ```
35
- Enumerating objects: 9049, done.
26
+ Enumerating objects: 9414, done.
36
- Counting objects: 100% (9049/9049), done.
27
+ Counting objects: 100% (9414/9414), done.
37
28
  Delta compression using up to 8 threads
38
- Compressing objects: 100% (7687/7687), done.
29
+ Compressing objects: 100% (8045/8045), done.
39
- Writing objects: 100% (9049/9049), 31.44 MiB | 211.00 KiB/s, done.
30
+ Writing objects: 100% (9414/9414), 31.47 MiB | 567.00 KiB/s, done.
40
- Total 9049 (delta 2278), reused 6930 (delta 849), pack-reused 0
31
+ Total 9414 (delta 2551), reused 6930 (delta 849), pack-reused 0
41
32
  remote: Compressing source files... done.
42
33
  remote: Building source:
43
34
  remote:
35
+ remote: -----> Node.js app detected
36
+ remote:
37
+ remote: -----> Creating runtime environment
38
+ remote:
39
+ remote: NPM_CONFIG_LOGLEVEL=error
40
+ remote: USE_YARN_CACHE=true
41
+ remote: NODE_ENV=production
42
+ remote: NODE_MODULES_CACHE=true
43
+ remote: NODE_VERBOSE=false
44
+ remote:
45
+ remote: -----> Installing binaries
46
+ remote: engines.node (package.json): unspecified
47
+ remote: engines.npm (package.json): unspecified (use default)
48
+ remote: engines.yarn (package.json): unspecified (use default)
49
+ remote:
50
+ remote: Resolving node version 12.x...
51
+ remote: Downloading and installing node 12.20.0...
52
+ remote: Using default npm version: 6.14.8
53
+ remote: Resolving yarn version 1.22.x...
54
+ remote: Downloading and installing yarn (1.22.10)
55
+ remote: Installed yarn 1.22.10
56
+ remote:
57
+ remote: -----> Installing dependencies
58
+ remote: Installing node modules (yarn.lock)
59
+ remote: yarn install v1.22.10
60
+ remote: [1/4] Resolving packages...
61
+ remote: [2/4] Fetching packages...
62
+ remote: info fsevents@2.1.3: The platform "linux" is incompatible with this module.
63
+ remote: info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
64
+ remote: info fsevents@1.2.13: The platform "linux" is incompatible with this module.
65
+ remote: info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
66
+ remote: [3/4] Linking dependencies...
67
+ remote: warning " > webpack-dev-server@3.11.0" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
68
+ remote: warning "webpack-dev-server > webpack-dev-middleware@3.7.2" has unmet peer dependency "webpack@^4.0.0".
69
+ remote: [4/4] Building fresh packages...
70
+ remote: Done in 34.94s.
71
+ remote:
72
+ remote: -----> Build
73
+ remote:
74
+ remote: -----> Pruning devDependencies
75
+ remote: yarn install v1.22.10
76
+ remote: [1/4] Resolving packages...
77
+ remote: [2/4] Fetching packages...
78
+ remote: info fsevents@2.1.3: The platform "linux" is incompatible with this module.
79
+ remote: info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
80
+ remote: info fsevents@1.2.13: The platform "linux" is incompatible with this module.
81
+ remote: info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
82
+ remote: [3/4] Linking dependencies...
83
+ remote: warning " > webpack-dev-server@3.11.0" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
84
+ remote: warning "webpack-dev-server > webpack-dev-middleware@3.7.2" has unmet peer dependency "webpack@^4.0.0".
85
+ remote: [4/4] Building fresh packages...
86
+ remote: warning Ignored scripts due to flag.
87
+ remote: Done in 6.71s.
88
+ remote:
89
+ remote: -----> Caching build
90
+ remote: - yarn cache
91
+ remote:
92
+ remote: -----> Build succeeded!
93
+ remote: ! Unmet dependencies don't fail yarn install but may cause runtime issues
94
+ remote: https://github.com/npm/npm/issues/7494
95
+ remote:
44
96
  remote: -----> Ruby app detected
45
- remote: -----> Installing bundler 1.17.3
97
+ remote: -----> Installing bundler 2.1.4
46
98
  remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
47
99
  remote: -----> Compiling Ruby/Rails
48
100
  remote: -----> Using Ruby version: ruby-2.6.6
49
- remote: -----> Installing dependencies using bundler 1.17.3
101
+ remote: -----> Installing dependencies using bundler 2.1.4
50
- remote: Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 BUNDLE_GLOBAL_PATH_APPENDS_RUBY_SCOPE=1 bundle install -j4
102
+ remote: Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
103
+ remote: /tmp/build_7d30a02c/bin/bundle:34:in `gemfile': undefined method `present?' for "/tmp/build_7d30a02c/Gemfile":String (NoMethodError)
104
+ remote: from /tmp/build_7d30a02c/bin/bundle:41:in `lockfile'
105
+ remote: from /tmp/build_7d30a02c/bin/bundle:49:in `lockfile_version'
106
+ remote: from /tmp/build_7d30a02c/bin/bundle:58:in `bundler_version'
51
- remote: /tmp/build_095af776/bin/bundle: line 1: require: command not found
107
+ remote: from /tmp/build_7d30a02c/bin/bundle:62:in `bundler_requirement'
108
+ remote: from /tmp/build_7d30a02c/bin/bundle:89:in `activate_bundler'
52
- remote: /tmp/build_095af776/bin/bundle: line 3: m: command not found
109
+ remote: from /tmp/build_7d30a02c/bin/bundle:78:in `load_bundler!'
110
+ remote: from /tmp/build_7d30a02c/bin/bundle:102:in `<main>'
111
+ remote: Bundler Output: /tmp/build_7d30a02c/bin/bundle:34:in `gemfile': undefined method `present?' for "/tmp/build_7d30a02c/Gemfile":String (NoMethodError)
112
+ remote: from /tmp/build_7d30a02c/bin/bundle:41:in `lockfile'
53
- remote: /tmp/build_095af776/bin/bundle: line 4: module_function: command not found
113
+ remote: from /tmp/build_7d30a02c/bin/bundle:49:in `lockfile_version'
114
+ remote: from /tmp/build_7d30a02c/bin/bundle:58:in `bundler_version'
54
- remote: /tmp/build_095af776/bin/bundle: line 6: def: command not found
115
+ remote: from /tmp/build_7d30a02c/bin/bundle:62:in `bundler_requirement'
55
- remote: /tmp/build_095af776/bin/bundle: line 7: syntax error near unexpected token `$PROGRAM_NAME'
56
- remote: /tmp/build_095af776/bin/bundle: line 7: ` File.expand_path($PROGRAM_NAME) == File.expand_path(__FILE__)'
57
- remote: Bundler Output: /tmp/build_095af776/bin/bundle: line 1: require: command not found
116
+ remote: from /tmp/build_7d30a02c/bin/bundle:89:in `activate_bundler'
58
- remote: /tmp/build_095af776/bin/bundle: line 3: m: command not found
117
+ remote: from /tmp/build_7d30a02c/bin/bundle:78:in `load_bundler!'
59
- remote: /tmp/build_095af776/bin/bundle: line 4: module_function: command not found
60
- remote: /tmp/build_095af776/bin/bundle: line 6: def: command not found
118
+ remote: from /tmp/build_7d30a02c/bin/bundle:102:in `<main>'
61
- remote: /tmp/build_095af776/bin/bundle: line 7: syntax error near unexpected token `$PROGRAM_NAME'
62
- remote: /tmp/build_095af776/bin/bundle: line 7: ` File.expand_path($PROGRAM_NAME) == File.expand_path(__FILE__)'
63
119
  remote:
64
120
  remote: !
65
121
  remote: ! Failed to install gems via Bundler.
@@ -67,31 +123,18 @@
67
123
  remote: ! Push rejected, failed to compile Ruby app.
68
124
  remote:
69
125
  remote: ! Push failed
70
- remote: !
71
- remote: ! ## Warning - The same version of this code has already been built: 24fab7dc0a9f00ebc1df6c2d6ffffb80f441baf0
72
- remote: !
73
- remote: ! We have detected that you have triggered a build from source code with version 24fab7dc0a9f00ebc1df6c2d6ffffb80f441baf0
74
- remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
75
- remote: !
76
- remote: ! If you are developing on a branch and deploying via git you must run:
77
- remote: !
78
- remote: ! git push heroku <branchname>:main
79
- remote: !
80
- remote: ! This article goes into details on the behavior:
81
- remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
82
- remote:
83
126
  remote: Verifying deploy...
84
127
  remote:
85
128
  remote: ! Push rejected to music-sns-app.
86
129
  remote:
87
130
  To https://git.heroku.com/music-sns-app.git
88
- ! [remote rejected] master -> main (pre-receive hook declined)
131
+ ! [remote rejected] heroku_deploy_error -> main (pre-receive hook declined)
89
132
  error: failed to push some refs to 'https://git.heroku.com/music-sns-app.git'
90
133
  ```
91
134
 
92
135
  ■heroku logs
93
136
  ```
94
- 2020-12-05T12:15:03.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/786fff75-2b3c-4a33-87c9-471ed76d3585/activity/builds/40df78a3-7aab-4c30-8fa9-aad43a9d675a
137
+ Build failed -- check your build output:URL
95
138
  ```
96
139
  ```gemfile
97
140
  source 'https://rubygems.org'

1

エラーの内容が変わった為

2020/12/13 07:22

投稿

renren
renren

スコア48

title CHANGED
@@ -1,1 +1,1 @@
1
- git push heroku master にてエラーが発生してしいます
1
+ すでデプロイ済みと言われpushできせん。
body CHANGED
@@ -1,8 +1,13 @@
1
1
  閲覧ありがとうございます!
2
2
 
3
3
  色々と調べてたのですが、解決できなかったので質問させてください。
4
- 現在、Railsにてオリジナルアプリを開発中なのですがherokuにデプロイできず詰まっております。
5
4
 
5
+ 現在、実務未経験で転職活動のため、Railsにてオリジナルアプリを開発中なのですがherokuにデプロイできず詰まっています...
6
+
7
+ 自分で色々と調べ、試したのですが解決せずどの様に解決したらいいのか分かりません...
8
+
9
+ 何卒、よろしくお願いいたします!!!
10
+
6
11
  現状は下記の通りです。
7
12
 
8
13
  ■スペック
@@ -12,25 +17,27 @@
12
17
 
13
18
  ■原因だと考えていること
14
19
  ・heroku logsにて確認したところ、ビルドが失敗しております。
15
- ・エラーメッセージにてbundle install失敗している?ような記述があります。
20
+ ・エラーメッセージにてすでにデプロイ済みですと警告ています。
16
21
 
17
22
  ■試したこと
18
23
  ・コミットしていることを確認。
19
- bundlerのバージョン2.1.4から1.17.3に変更(2.0以上だとエラーが発生する原因になるという記事を見つけ為)
24
+ herokuアプリ削除し、再度作り直しまし
20
- bundle -v にてバージョンが1.17.3変更していこと確認
25
+ エラメッセージにgit push heroku ブランチ名:mainコマンド実行
26
+ →git push heroku master:main
27
+ →git push heroku develop:main
28
+ どちらも同じエラーが出てデプロイできませんでした...
21
29
 
22
30
 
23
31
  お手数おかけしますが、何卒よろしくお願いいたします。
24
32
 
25
-
26
33
  ■エラーメッセージ(git push heroku master後)
27
34
  ```
28
- Enumerating objects: 8838, done.
35
+ Enumerating objects: 9049, done.
29
- Counting objects: 100% (8838/8838), done.
36
+ Counting objects: 100% (9049/9049), done.
30
37
  Delta compression using up to 8 threads
31
- Compressing objects: 100% (7488/7488), done.
38
+ Compressing objects: 100% (7687/7687), done.
32
- Writing objects: 100% (8838/8838), 26.93 MiB | 187.00 KiB/s, done.
39
+ Writing objects: 100% (9049/9049), 31.44 MiB | 211.00 KiB/s, done.
33
- Total 8838 (delta 2129), reused 6930 (delta 849), pack-reused 0
40
+ Total 9049 (delta 2278), reused 6930 (delta 849), pack-reused 0
34
41
  remote: Compressing source files... done.
35
42
  remote: Building source:
36
43
  remote:
@@ -41,18 +48,18 @@
41
48
  remote: -----> Using Ruby version: ruby-2.6.6
42
49
  remote: -----> Installing dependencies using bundler 1.17.3
43
50
  remote: Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 BUNDLE_GLOBAL_PATH_APPENDS_RUBY_SCOPE=1 bundle install -j4
44
- remote: /tmp/build_bb48b25b/bin/bundle: line 1: require: command not found
51
+ remote: /tmp/build_095af776/bin/bundle: line 1: require: command not found
45
- remote: /tmp/build_bb48b25b/bin/bundle: line 3: m: command not found
52
+ remote: /tmp/build_095af776/bin/bundle: line 3: m: command not found
46
- remote: /tmp/build_bb48b25b/bin/bundle: line 4: module_function: command not found
53
+ remote: /tmp/build_095af776/bin/bundle: line 4: module_function: command not found
47
- remote: /tmp/build_bb48b25b/bin/bundle: line 6: def: command not found
54
+ remote: /tmp/build_095af776/bin/bundle: line 6: def: command not found
48
- remote: /tmp/build_bb48b25b/bin/bundle: line 7: syntax error near unexpected token `$PROGRAM_NAME'
55
+ remote: /tmp/build_095af776/bin/bundle: line 7: syntax error near unexpected token `$PROGRAM_NAME'
49
- remote: /tmp/build_bb48b25b/bin/bundle: line 7: ` File.expand_path($PROGRAM_NAME) == File.expand_path(__FILE__)'
56
+ remote: /tmp/build_095af776/bin/bundle: line 7: ` File.expand_path($PROGRAM_NAME) == File.expand_path(__FILE__)'
50
- remote: Bundler Output: /tmp/build_bb48b25b/bin/bundle: line 1: require: command not found
57
+ remote: Bundler Output: /tmp/build_095af776/bin/bundle: line 1: require: command not found
51
- remote: /tmp/build_bb48b25b/bin/bundle: line 3: m: command not found
58
+ remote: /tmp/build_095af776/bin/bundle: line 3: m: command not found
52
- remote: /tmp/build_bb48b25b/bin/bundle: line 4: module_function: command not found
59
+ remote: /tmp/build_095af776/bin/bundle: line 4: module_function: command not found
53
- remote: /tmp/build_bb48b25b/bin/bundle: line 6: def: command not found
60
+ remote: /tmp/build_095af776/bin/bundle: line 6: def: command not found
54
- remote: /tmp/build_bb48b25b/bin/bundle: line 7: syntax error near unexpected token `$PROGRAM_NAME'
61
+ remote: /tmp/build_095af776/bin/bundle: line 7: syntax error near unexpected token `$PROGRAM_NAME'
55
- remote: /tmp/build_bb48b25b/bin/bundle: line 7: ` File.expand_path($PROGRAM_NAME) == File.expand_path(__FILE__)'
62
+ remote: /tmp/build_095af776/bin/bundle: line 7: ` File.expand_path($PROGRAM_NAME) == File.expand_path(__FILE__)'
56
63
  remote:
57
64
  remote: !
58
65
  remote: ! Failed to install gems via Bundler.
@@ -60,12 +67,25 @@
60
67
  remote: ! Push rejected, failed to compile Ruby app.
61
68
  remote:
62
69
  remote: ! Push failed
70
+ remote: !
71
+ remote: ! ## Warning - The same version of this code has already been built: 24fab7dc0a9f00ebc1df6c2d6ffffb80f441baf0
72
+ remote: !
73
+ remote: ! We have detected that you have triggered a build from source code with version 24fab7dc0a9f00ebc1df6c2d6ffffb80f441baf0
74
+ remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
75
+ remote: !
76
+ remote: ! If you are developing on a branch and deploying via git you must run:
77
+ remote: !
78
+ remote: ! git push heroku <branchname>:main
79
+ remote: !
80
+ remote: ! This article goes into details on the behavior:
81
+ remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
82
+ remote:
63
83
  remote: Verifying deploy...
64
84
  remote:
65
85
  remote: ! Push rejected to music-sns-app.
66
86
  remote:
67
87
  To https://git.heroku.com/music-sns-app.git
68
- ! [remote rejected] master -> master (pre-receive hook declined)
88
+ ! [remote rejected] master -> main (pre-receive hook declined)
69
89
  error: failed to push some refs to 'https://git.heroku.com/music-sns-app.git'
70
90
  ```
71
91