質問編集履歴
5
質問追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -152,6 +152,58 @@
|
|
152
152
|
|
153
153
|
```
|
154
154
|
|
155
|
+
上記はRakefileの以下をコメントアウトすることで解決
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
```
|
160
|
+
|
161
|
+
# require 'ci/reporter/rake/rspec'
|
162
|
+
|
163
|
+
```
|
164
|
+
|
165
|
+
その後be rake rails:updateを実行、マージした後、rails sをすると以下のようなエラーが出るようになる
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
```
|
170
|
+
|
171
|
+
=> Booting WEBrick
|
172
|
+
|
173
|
+
=> Rails 4.0.13 application starting in oreopment on http://0.0.0.0:3000
|
174
|
+
|
175
|
+
=> Run `rails server -h` for more startup options
|
176
|
+
|
177
|
+
=> Ctrl-C to shutdown server
|
178
|
+
|
179
|
+
Exiting
|
180
|
+
|
181
|
+
/home/ore/.rbenv/versions/2.2.3/gemsets/rails4/gems/actionpack-4.0.13/lib/action_dispatch/routing/route_set.rb:430:in `add_route': Invalid route name, already in use: 'apl_new_login' (ArgumentError)
|
182
|
+
|
183
|
+
You may have defined two routes with the same name using the `:as` option, or you may be overriding a route already defined by a resource with the same naming. For the latter, you can restrict the routes created with `resources` as explained here:
|
184
|
+
|
185
|
+
http://guides.rubyonrails.org/routing.html#restricting-the-routes-created
|
186
|
+
|
187
|
+
from /home/ore/.rbenv/versions/2.2.3/gemsets/rails4/gems/actionpack-4.0.13/lib/action_dispatch/routing/mapper.rb:1484:in `add_route'
|
188
|
+
|
189
|
+
from /home/ore/.rbenv/versions/2.2.3/gemsets/rails4/gems/actionpack-4.0.13/lib/action_dispatch/routing/mapper.rb:1461:in `decomposed_match'
|
190
|
+
|
191
|
+
from /home/ore/.rbenv/versions/2.2.3/gemsets/rails4/gems/actionpack-4.0.13/lib/action_dispatch/routing/mapper.rb:1442:in `block in match'
|
192
|
+
|
193
|
+
from /home/ore/.rbenv/versions/2.2.3/gemsets/rails4/gems/actionpack-4.0.13/lib/action_dispatch/routing/mapper.rb:1433:in `each'
|
194
|
+
|
195
|
+
from /home/ore/.rbenv/versions/2.2.3/gemsets/rails4/gems/actionpack-4.0.13/lib/action_dispatch/routing/mapper.rb:1433:in `match'
|
196
|
+
|
197
|
+
from /home/ore/.rbenv/versions/2.2.3/gemsets/rails4/gems/actionpack-4.0.13/lib/action_dispatch/routing/mapper.rb:626:in `map_method'
|
198
|
+
|
199
|
+
from /home/ore/.rbenv/versions/2.2.3/gemsets/rails4/gems/actionpack-4.0.13/lib/action_dispatch/routing/mapper.rb:587:in `get'
|
200
|
+
|
201
|
+
from /home/ore/workspace/4.0_app/config/routes.rb:33:in `block (4 levels) in <top (required)>'
|
202
|
+
|
203
|
+
from /home/ore/.rbenv/versions/2.2.3/gemsets/rails4/gems/actionpack-4.0.13/lib/action_dispatch/routing/mapper.rb:877:in `block in constraints'
|
204
|
+
|
205
|
+
```
|
206
|
+
|
155
207
|
|
156
208
|
|
157
209
|
###補足情報(言語/FW/ツール等のバージョンなど)
|
4
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -114,7 +114,43 @@
|
|
114
114
|
|
115
115
|
```
|
116
116
|
|
117
|
+
依存関係キリが無さそうだったのでbundle updateしたらアップデート完了しました。
|
117
118
|
|
119
|
+
```
|
120
|
+
|
121
|
+
[~4.0_app]$ rbenv exec bundle update
|
122
|
+
|
123
|
+
:
|
124
|
+
|
125
|
+
:
|
126
|
+
|
127
|
+
Bundle updated!
|
128
|
+
|
129
|
+
```
|
130
|
+
|
131
|
+
次はrakeコマンドで失敗するように
|
132
|
+
|
133
|
+
```
|
134
|
+
|
135
|
+
[~4.0_app]$ rake rails:update
|
136
|
+
|
137
|
+
rake aborted!
|
138
|
+
|
139
|
+
LoadError: cannot load such file -- ci/reporter/rake/rspec
|
140
|
+
|
141
|
+
/home/ore/.rbenv/versions/2.2.3/gemsets/rails4/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:229:in `require'
|
142
|
+
|
143
|
+
/home/ore/.rbenv/versions/2.2.3/gemsets/rails4/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:229:in `block in require'
|
144
|
+
|
145
|
+
/home/ore/.rbenv/versions/2.2.3/gemsets/rails4/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:214:in `load_dependency'
|
146
|
+
|
147
|
+
/home/ore/.rbenv/versions/2.2.3/gemsets/rails4/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:229:in `require'
|
148
|
+
|
149
|
+
/home/ore/workspace/app/Rakefile:9:in `<top (required)>'
|
150
|
+
|
151
|
+
(See full trace by running task with --trace)
|
152
|
+
|
153
|
+
```
|
118
154
|
|
119
155
|
|
120
156
|
|
3
質問の変更
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Railsを3.2から4.0にバージョンアップしたい
|
test
CHANGED
@@ -1,11 +1,121 @@
|
|
1
1
|
###前提・実現したいこと
|
2
|
+
|
3
|
+
既存システムのRailsを3.2最新から4.0最新にバージョンアップしたい
|
4
|
+
|
5
|
+
###発生している問題・エラーメッセージ
|
6
|
+
|
7
|
+
```
|
8
|
+
|
9
|
+
[~4.0_app]$ rbenv exec bundle update rails
|
10
|
+
|
11
|
+
Fetching gem metadata from https://rubygems.org/..........
|
12
|
+
|
13
|
+
Fetching version metadata from https://rubygems.org/...
|
14
|
+
|
15
|
+
Fetching dependency metadata from https://rubygems.org/..
|
16
|
+
|
17
|
+
Resolving dependencies........
|
18
|
+
|
19
|
+
Bundler could not find compatible versions for gem "rails":
|
20
|
+
|
21
|
+
In Gemfile:
|
22
|
+
|
23
|
+
spork-rails (>= 0) ruby depends on
|
24
|
+
|
25
|
+
rails (< 3.3.0, >= 3.0.0) ruby
|
2
26
|
|
3
27
|
|
4
28
|
|
29
|
+
rails (~> 4.0.13) ruby
|
30
|
+
|
31
|
+
```
|
32
|
+
|
33
|
+
Gemfileでgem 'spork-rails', '4.0.0'を指定して再度実行
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
```
|
38
|
+
|
39
|
+
[~4.0_app]$ rbenv exec bundle update rails
|
40
|
+
|
41
|
+
Fetching gem metadata from https://rubygems.org/..........
|
42
|
+
|
43
|
+
Fetching version metadata from https://rubygems.org/...
|
44
|
+
|
45
|
+
Fetching dependency metadata from https://rubygems.org/..
|
46
|
+
|
47
|
+
Resolving dependencies........
|
48
|
+
|
49
|
+
Bundler could not find compatible versions for gem "sass":
|
50
|
+
|
51
|
+
In snapshot (Gemfile.lock):
|
52
|
+
|
53
|
+
sass (= 3.2.1)
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
In Gemfile:
|
58
|
+
|
59
|
+
compass-rails (>= 0) ruby depends on
|
60
|
+
|
61
|
+
compass (< 0.14, >= 0.12.2) ruby depends on
|
62
|
+
|
5
|
-
|
63
|
+
sass (~> 3.1) ruby
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
sass-rails (~> 4.0.0) ruby depends on
|
68
|
+
|
69
|
+
sass (~> 3.2.2) ruby
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
Running `bundle update` will rebuild your snapshot from scratch, using only
|
74
|
+
|
75
|
+
the gems in your Gemfile, which may resolve the conflict.
|
76
|
+
|
77
|
+
Bundler could not find compatible versions for gem "railties":
|
78
|
+
|
79
|
+
In Gemfile:
|
80
|
+
|
81
|
+
railties (>= 3.1.0) ruby
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
railties (< 5.0, >= 3.1.0) ruby
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
railties (>= 3.0) ruby
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
quiet_assets (>= 0) ruby depends on
|
94
|
+
|
95
|
+
railties (~> 3.1) ruby
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
rails (~> 4.0.13) ruby depends on
|
100
|
+
|
101
|
+
railties (= 4.0.13) ruby
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
coffee-rails (~> 4.0.0) ruby depends on
|
106
|
+
|
107
|
+
railties (< 5.0, >= 4.0.0) ruby
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
coffee-rails (~> 4.0.0) ruby depends on
|
112
|
+
|
113
|
+
railties (< 5.0, >= 4.0.0) ruby
|
114
|
+
|
115
|
+
```
|
116
|
+
|
117
|
+
|
6
118
|
|
7
119
|
|
8
120
|
|
9
121
|
###補足情報(言語/FW/ツール等のバージョンなど)
|
10
|
-
|
11
|
-
.11.0)
|
2
削除
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rs
|
1
|
+
rs
|
test
CHANGED
@@ -1,85 +1,11 @@
|
|
1
1
|
###前提・実現したいこと
|
2
|
-
|
3
|
-
システムをruby 1.9.2p⇒2.2.3へバージョンアップしようとしてます。railsのバージョンは3.2.19 DBはmysqlを使用しています。railsは後ほどバージョンアップします。
|
4
|
-
|
5
|
-
テストを実行したところエラーが発生し lambdaを使って例外発生させようとしているのにraise_errorしてくれないエラーを解決したいと思っています。
|
6
2
|
|
7
3
|
|
8
4
|
|
9
5
|
###発生している問題・エラーメッセージ
|
10
6
|
|
11
|
-
何もraisedされていないとメッセージ
|
12
|
-
|
13
|
-
```error.log
|
14
|
-
|
15
|
-
Failures:
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
1) …の場合は、 そのまま例外をraiseする。
|
20
|
-
|
21
|
-
Failure/Error: lambda{Job.find_by_id(@conn, 0)}.should raise_error(ex)
|
22
|
-
|
23
|
-
expected Unauthorized but nothing was raised
|
24
|
-
|
25
|
-
```
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
###ソースコード
|
30
|
-
|
31
|
-
プロダクトコードです。
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
```プロダクト.rb
|
36
|
-
|
37
|
-
def self.find_by_id(conn, id)
|
38
|
-
|
39
|
-
options = {…}
|
40
|
-
|
41
|
-
response = Job.mrq(conn, options)
|
42
|
-
|
43
|
-
```
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
テストコードです。raisedさせようとしてます。
|
48
|
-
|
49
|
-
```test.rb
|
50
|
-
|
51
|
-
before(:each) do
|
52
|
-
|
53
|
-
Job.should_receive(:mrq).and_raise(ex)
|
54
|
-
|
55
|
-
end
|
56
|
-
|
57
|
-
context "…の場合は、" do
|
58
|
-
|
59
|
-
let(:ex){Fog::Compute::Cloudstack::Unauthorized.new("Unauthorized", 401)}
|
60
|
-
|
61
|
-
it "そのまま例外をraiseする。" do
|
62
|
-
|
63
|
-
lambda{Job.find_by_id(@conn, 0)}.should raise_error(ex)
|
64
|
-
|
65
|
-
end
|
66
|
-
|
67
|
-
end
|
68
|
-
|
69
|
-
```
|
70
|
-
|
71
7
|
|
72
8
|
|
73
9
|
###補足情報(言語/FW/ツール等のバージョンなど)
|
74
10
|
|
75
|
-
rspec gem情報
|
76
|
-
|
77
|
-
|
11
|
+
.11.0)
|
78
|
-
|
79
|
-
rspec-core (2.11.1)
|
80
|
-
|
81
|
-
rspec-expectations (2.11.3)
|
82
|
-
|
83
|
-
rspec-mocks (2.11.3)
|
84
|
-
|
85
|
-
rspec-rails (2.11.0)
|
1
不十分な記述を追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -34,7 +34,11 @@
|
|
34
34
|
|
35
35
|
```プロダクト.rb
|
36
36
|
|
37
|
+
def self.find_by_id(conn, id)
|
38
|
+
|
39
|
+
options = {…}
|
40
|
+
|
37
|
-
response = Job.mrq(conn, options)
|
41
|
+
response = Job.mrq(conn, options)
|
38
42
|
|
39
43
|
```
|
40
44
|
|