質問編集履歴

2

問題点が前回よりも明確になったため

2019/11/22 10:58

投稿

退会済みユーザー
test CHANGED
@@ -1 +1 @@
1
- 「bundle install --without production」際、Gem毎Bundlerバージョンを指定したいです。
1
+ Heroku上でmecab使えようにしたいです。
test CHANGED
@@ -1,12 +1,12 @@
1
1
  ###実現したいこと
2
2
 
3
- 「negapoji」というgemを用いて、Twitterの投稿から相手が元気であるか調べウェブアプリケーションの作成
3
+ ######Heroku上でmecab使えようにすること
4
4
 
5
5
 
6
6
 
7
7
  ###環境
8
8
 
9
- Mac
9
+ macOS Mojave
10
10
 
11
11
  Atom
12
12
 
@@ -18,11 +18,7 @@
18
18
 
19
19
  ### 問題点
20
20
 
21
- Herokuを使ってRails5で制作したウェブページを投稿したいのですが、「git push heroku master」が行きせん
22
-
23
- 「negapoji」というgem(参照:https://github.com/hatt0519/negapoji)に問題があると考えています。
24
-
25
- 古いジェムであるため、最新のBundler(2.0.2)では使えず、古いBundler(1.11.0)なら使えると考え、「bundle _1.11.0_ install --without production」をしましたが、他のgemが使えなくなってしまいました。「bundle install --without production」の時、「negapoji」のみをバージョンの低いBundlerでインストールできれば問題が解決すると思います。しかし、やり方がわかりませんでした。
21
+ Herokuを使ってRails5で制作したウェブページを投稿したいのですが、Rails内で使用した"mecab"というGemがHeroku上では使えないらし、導入する方法を探してい
26
22
 
27
23
 
28
24
 
@@ -33,6 +29,20 @@
33
29
  $ git push heroku master
34
30
 
35
31
  (中略)
32
+
33
+ remote: An error occurred while installing mecab (0.996), and Bundler cannot continue.
34
+
35
+ remote: Make sure that `gem install mecab -v '0.996' --source 'https://rubygems.org/'`
36
+
37
+ remote: succeeds before bundling.
38
+
39
+ remote:
40
+
41
+ remote: In Gemfile:
42
+
43
+ remote: mecab
44
+
45
+ remote:
36
46
 
37
47
  remote: !
38
48
 
@@ -50,15 +60,15 @@
50
60
 
51
61
  remote:
52
62
 
53
- remote: ! Push rejected to enigmatic-ocean-33142.
63
+ remote: ! Push rejected to feelslikeany.
54
64
 
55
65
  remote:
56
66
 
57
- To https://git.heroku.com/enigmatic-ocean-33142.git
67
+ To https://git.heroku.com/feelslikeany.git
58
68
 
59
69
  ! [remote rejected] master -> master (pre-receive hook declined)
60
70
 
61
- error: failed to push some refs to 'https://git.heroku.com/enigmatic-ocean-33142.git'
71
+ error: failed to push some refs to 'https://git.heroku.com/feelslikeany.git'
62
72
 
63
73
  (終了)
64
74
 
@@ -72,11 +82,15 @@
72
82
 
73
83
  ```ここに言語名を入力
74
84
 
75
- 以下はGemfileです。
85
+ 以下はRailsのGemfileです。
76
86
 
77
87
 
78
88
 
89
+ (中略)
90
+
79
91
  gem 'mecab'
92
+
93
+ gem 'natto'
80
94
 
81
95
  gem 'twitter'
82
96
 
@@ -88,9 +102,9 @@
88
102
 
89
103
  gem "font-awesome-sass"
90
104
 
105
+ gem 'pg', group: :production
91
106
 
92
-
93
- gem 'pg', group: :production
107
+ (終了)
94
108
 
95
109
 
96
110
 
@@ -100,28 +114,26 @@
100
114
 
101
115
  ### 試したこと
102
116
 
117
+ https://qiita.com/shouta-dev/items/cd538a77f2b729333025
118
+
103
- 「negapoji」はGitHubは公開されていまが、Rubygems.orgには登録されていない野良gemであるめ、Gemfile内でGit場所を指定しました。
119
+ 上記のサイトを参考ていこうと考えていしたが、設定ファイルの作成でわからなくなっしままし。(疑問:cellar,.buildpackはどこにあるか)
104
120
 
105
121
 
106
122
 
107
- 「bundle _1.11.0_ install --without production」をしてBundlerのバージョンを指定しましたが、他のGemも使用できなくなりました。
123
+ https://www.tcom242242.site/entry/2016/12/11/093837
124
+
125
+ 上記のサイトも試してみましたが、結果は変わらずでした。
108
126
 
109
127
 
110
128
 
111
-
129
+ また、上記以外の方法がありましたら、ご教示お願いします。
112
130
 
113
131
 
114
132
 
115
133
  ### 補足情報(FW/ツールのバージョンなど)
116
134
 
117
- 制作で参考にしたウェブサイト
118
-
119
- https://qiita.com/moroku0519/items/e6352d31311418f38227
120
-
121
- https://qiita.com/snumano/items/7b85b4f55eea966a65f1
135
+ 野良Gemである"negapoji"を利用するため、Bundlerは1.11.0を利用しています。
122
136
 
123
137
 
124
138
 
125
- 題解決参考にたウェブサイト
139
+ 基礎中の基礎な質問であるのは承知でありますが、どうかよろくお願いします。
126
-
127
- https://www.softel.co.jp/blogs/tech/archives/3569

1

Gemfileに「gem 'mecab'」を加えたことでエラーが減ったため

2019/11/22 10:58

投稿

退会済みユーザー
test CHANGED
@@ -1 +1 @@
1
- 野良Gem「negapoji」をgitでpushできようにしたいです。
1
+ bundle install --without production」を際、Gem毎Bundlerバージョンを指定したいです。
test CHANGED
@@ -20,7 +20,9 @@
20
20
 
21
21
  Herokuを使ってRails5で制作したウェブページを投稿したいのですが、「git push heroku master」が上手く行きません。
22
22
 
23
- どうやら、「negapoji」というgem(参照:https://github.com/hatt0519/negapoji)に問題があるらしのでが解決方法がわかりません
23
+ 「negapoji」というgem(参照:https://github.com/hatt0519/negapoji)に問題があると考えてす。
24
+
25
+ 古いジェムであるため、最新のBundler(2.0.2)では使えず、古いBundler(1.11.0)なら使えると考え、「bundle _1.11.0_ install --without production」をしましたが、他のgemが使えなくなってしまいました。「bundle install --without production」の時、「negapoji」のみをバージョンの低いBundlerでインストールできれば問題が解決すると思います。しかし、やり方がわかりませんでした。
24
26
 
25
27
 
26
28
 
@@ -30,71 +32,33 @@
30
32
 
31
33
  $ git push heroku master
32
34
 
33
-
34
-
35
35
  (中略)
36
-
37
-
38
36
 
39
37
  remote: !
40
38
 
41
- remote: ! Could not detect rake tasks
39
+ remote: ! Failed to install gems via Bundler.
42
-
43
- remote: ! ensure you can run `$ bundle exec rake -P` against your app
44
-
45
- remote: ! and using the production group of your Gemfile.
46
-
47
- remote: ! rake aborted!
48
-
49
- remote: ! LoadError: Please set MECAB_PATH to the full path to libmecab.so
50
-
51
- remote: !
52
-
53
- /tmp/build_287b22ef65f95528004c6e169c57b5ce/vendor/bundle/ruby/2.5.0/gems/natto-1.1.2/lib/natto/binding.rb:58:in `rescue in find_library'
54
-
55
-
56
-
57
- (中略:1つ前の「remote: !」が永遠と続く)
58
-
59
-
60
-
61
- remote: ! vendor/bundle/bin/rake:29:in `load'
62
-
63
- remote: ! vendor/bundle/bin/rake:29:in `<main>'
64
-
65
- remote: !
66
-
67
- remote: ! Caused by:
68
-
69
- remote: ! Errno::ENOENT: No such file or directory - mecab-config
70
-
71
-
72
-
73
- (中略)
74
-
75
-
76
-
77
- remote: ! vendor/bundle/bin/rake:29:in `load'
78
-
79
- remote: ! vendor/bundle/bin/rake:29:in `<main>'
80
40
 
81
41
  remote: !
82
42
 
83
- remote: /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/rake_runner.rb:106:in `load_rake_tasks!': Could not detect rake tasks (LanguagePack::Helpers::RakeRunner::CannotLoadRakefileError)
43
+ remote: ! Push rejected, failed to compile Ruby app.
84
44
 
45
+ remote:
85
46
 
47
+ remote: ! Push failed
86
48
 
87
- (中略)
49
+ remote: Verifying deploy...
88
50
 
51
+ remote:
89
52
 
53
+ remote: ! Push rejected to enigmatic-ocean-33142.
90
54
 
55
+ remote:
56
+
91
- To https://git.heroku.com/feelslikeany.git
57
+ To https://git.heroku.com/enigmatic-ocean-33142.git
92
58
 
93
59
  ! [remote rejected] master -> master (pre-receive hook declined)
94
60
 
95
- error: failed to push some refs to 'https://git.heroku.com/feelslikeany.git'
61
+ error: failed to push some refs to 'https://git.heroku.com/enigmatic-ocean-33142.git'
96
-
97
-
98
62
 
99
63
  (終了)
100
64
 
@@ -111,6 +75,8 @@
111
75
  以下はGemfileです。
112
76
 
113
77
 
78
+
79
+ gem 'mecab'
114
80
 
115
81
  gem 'twitter'
116
82
 
@@ -136,7 +102,11 @@
136
102
 
137
103
  「negapoji」はGitHubには公開されていますが、Rubygems.orgには登録されていない野良gemであるため、Gemfile内でGitの場所を指定しました。
138
104
 
105
+
106
+
139
- 古いジェムであるため、最新のbundler(2.0.2)では使えず、古いbundler(1.11.0)なら使えると考え、「bundle _1.11.0_ install --without production」をしましたが、他のgem使なくなってしいました。
107
+ 「bundle _1.11.0_ install --without production」をしてBundlerのバージョンを指定しましたが、他のGem使用できなくなました。
108
+
109
+
140
110
 
141
111
 
142
112