Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 部署到Heroku应用程序错误_Ruby On Rails_Ruby_Heroku_Deployment_Ruby On Rails 4 - Fatal编程技术网

Ruby on rails 部署到Heroku应用程序错误

Ruby on rails 部署到Heroku应用程序错误,ruby-on-rails,ruby,heroku,deployment,ruby-on-rails-4,Ruby On Rails,Ruby,Heroku,Deployment,Ruby On Rails 4,我向你展示了你所见过的最长的圆木。我正在努力学习Hartl的教程,在我尝试将应用程序推送到heroku之前,一切都很好。我得到错误“应用程序错误 应用程序中出现错误,无法提供您的页面。请稍后再试。 如果您是应用程序所有者,请查看日志以了解详细信息。“ 我不知道我会错在哪里。我花了三个小时的时间想弄清楚这件事。感谢您的帮助 2013-12-08T10:22:44.588867+00:00 app[web.1]: => Booting WEBrick 2013-12-08T10:22:44.5

我向你展示了你所见过的最长的圆木。我正在努力学习Hartl的教程,在我尝试将应用程序推送到heroku之前,一切都很好。我得到错误“应用程序错误 应用程序中出现错误,无法提供您的页面。请稍后再试。 如果您是应用程序所有者,请查看日志以了解详细信息。

我不知道我会错在哪里。我花了三个小时的时间想弄清楚这件事。感谢您的帮助

2013-12-08T10:22:44.588867+00:00 app[web.1]: => Booting WEBrick
2013-12-08T10:22:44.588867+00:00 app[web.1]: => Rails 4.0.1 application starting
 in production on http://0.0.0.0:46179
2013-12-08T10:22:44.588867+00:00 app[web.1]: => Run `rails server -h` for more s
tartup options
2013-12-08T10:22:44.588867+00:00 app[web.1]: => Ctrl-C to shutdown server
2013-12-08T10:22:44.588867+00:00 app[web.1]: Exiting
2013-12-08T10:22:44.589578+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/
activemodel-4.0.1/lib/active_model/deprecated_mass_assignment_security.rb:14:in
`attr_accessible': `attr_accessible` is extracted out of Rails into a gem. Pleas
e use new recommended protection model for params(strong_parameters) or add `pro
tected_attributes` to your Gemfile to use old one. (RuntimeError)

编辑:这是我取出attr_Accessible时发生的情况。我现在可以在heroku上得到它,但我得到了这些rspec错误。有什么想法吗

 ' c:\Sites\sample_app>bundle exec rspec spec/
including Capybara::DSL in the global scope is not recommended!
.F.............F......FF..FFF..

Failures:

  1) User pages signup with valid information should create a user
     Failure/Error: expect { click_button submit }.to change(User, :count).by(1)

       count should have been changed by 1, but was changed by 0
     # ./spec/requests/user_pages_spec.rb:46:in `block (4 levels) in <top (requi
red)>'

  2) User
     Failure/Error: it { should be_valid }
       expected #<User id: nil, name: nil, email: nil, created_at: nil, updated_
at: nil, password_digest: nil, password: nil> to be valid, but got errors: Passw
ord can't be blank, Password is too short (minimum is 6 characters), Name can't
be blank, Email can't be blank, Email is invalid, Password confirmation can't be
 blank
     # ./spec/models/user_spec.rb:19:in `block (2 levels) in <top (required)>'

  3) User when email address is already taken
     Failure/Error: user_with_same_email.email = @user.email.upcase
     NoMethodError:
       undefined method `upcase' for nil:NilClass
     # ./spec/models/user_spec.rb:79:in `block (3 levels) in <top (required)>'

  4) User when email format is valid should be valid
     Failure/Error: @user.should be_valid
       expected #<User id: nil, name: nil, email: "user@foo.COM", created_at: ni
l, updated_at: nil, password_digest: nil, password: nil> to be valid, but got er
rors: Password can't be blank, Password is too short (minimum is 6 characters),
Name can't be blank, Password confirmation can't be blank
     # ./spec/models/user_spec.rb:71:in `block (4 levels) in <top (required)>'
     # ./spec/models/user_spec.rb:69:in `each'
     # ./spec/models/user_spec.rb:69:in `block (3 levels) in <top (required)>'

  5) User return value of authenticate method with valid password
     Failure/Error: it { should == found_user.authenticate(@user.password) }
     NoMethodError:
       undefined method `authenticate' for nil:NilClass
     # ./spec/models/user_spec.rb:43:in `block (4 levels) in <top (required)>'

  6) User return value of authenticate method with invalid password
     Failure/Error: let(:user_for_invalid_password) { found_user.authenticate("i
nvalid") }
     NoMethodError:
       undefined method `authenticate' for nil:NilClass
     # ./spec/models/user_spec.rb:47:in `block (4 levels) in <top (required)>'
     # ./spec/models/user_spec.rb:49:in `block (4 levels) in <top (required)>'

  7) User return value of authenticate method with invalid password
     Failure/Error: let(:user_for_invalid_password) { found_user.authenticate("i
nvalid") }
     NoMethodError:
       undefined method `authenticate' for nil:NilClass
     # ./spec/models/user_spec.rb:47:in `block (4 levels) in <top (required)>'
     # ./spec/models/user_spec.rb:50:in `block (4 levels) in <top (required)>'

Finished in 0.37081 seconds
31 examples, 7 failures

Failed examples:

rspec ./spec/requests/user_pages_spec.rb:45 # User pages signup with valid infor
mation should create a user
rspec ./spec/models/user_spec.rb:19 # User
rspec ./spec/models/user_spec.rb:83 # User when email address is already taken
rspec ./spec/models/user_spec.rb:67 # User when email format is valid should be
valid
rspec ./spec/models/user_spec.rb:43 # User return value of authenticate method w
ith valid password
rspec ./spec/models/user_spec.rb:49 # User return value of authenticate method w
ith invalid password
rspec ./spec/models/user_spec.rb:50 # User return value of authenticate method w
ith invalid password'
'c:\Sites\sample\u app>bundle exec rspec spec/
不建议将Capybara::DSL包含在全局范围内!
.F…………F…………FF…………FFF。。
失败:
1) 使用有效信息注册的用户页面应创建一个用户
失败/错误:期望{click_button submit}.更改(用户:count).by(1)
计数应更改为1,但更改为0
#./spec/requests/user\u pages\u spec.rb:46:in'block(4级)in'
2) 使用者
失败/错误:它{应该是有效的}
应为有效,但出现错误:Passw
ord不能为空,密码太短(至少6个字符),名称不能为空
为空,电子邮件不能为空,电子邮件无效,密码确认不能为空
空白的
#./spec/models/user_spec.rb:19:in'block(2层)in'
3) 电子邮件地址已被占用时的用户
失败/错误:用户\u与\u相同\u email.email=@user.email.upcase
命名错误:
nil:NilClass的未定义方法“upcase”
#./spec/models/user_spec.rb:79:in'block(3层)in'
4) 当电子邮件格式有效时,用户应该是有效的
失败/错误:@user.should\u有效
预计有效,但得到了更高的回报
rors:密码不能为空,密码太短(至少6个字符),
名称不能为空,密码确认不能为空
#./spec/models/user_spec.rb:71:in'block(4层)in'
#./spec/models/user_spec.rb:69:in'each'
#./spec/models/user_spec.rb:69:in'block(3层)in'
5) 使用有效密码验证方法的用户返回值
失败/错误:它{should==found\u user.authenticate(@user.password)}
命名错误:
nil:NilClass的未定义方法“authenticate”
#./spec/models/user_spec.rb:43:in'block(4层)in'
6) 密码无效的authenticate方法的用户返回值
失败/错误:let(:user\u for\u invalid\u password){found\u user.authenticate(“i
nvalid“}
命名错误:
nil:NilClass的未定义方法“authenticate”
#./spec/models/user_spec.rb:47:in'block(4层)in'
#./spec/models/user_spec.rb:49:in'block(4层)in'
7) 密码无效的authenticate方法的用户返回值
失败/错误:let(:user\u for\u invalid\u password){found\u user.authenticate(“i
nvalid“}
命名错误:
nil:NilClass的未定义方法“authenticate”
#./spec/models/user_spec.rb:47:in'block(4层)in'
#./spec/models/user_spec.rb:50:in'block(4层)in'
以0.37081秒完成
31例,7例失败
失败的示例:
rspec./spec/requests/user_pages_spec.rb:45#使用有效信息注册的用户页面
信息应该创建一个用户
rspec./spec/models/user_spec.rb:19#user
rspec./spec/models/user_spec.rb:83#当电子邮件地址已被占用时的用户
rspec./spec/models/user_spec.rb:67#电子邮件格式有效的用户应
有效的
rspec./spec/models/user_spec.rb:43#验证方法w的用户返回值
第i个有效密码
rspec./spec/models/user_spec.rb:49#验证方法w的用户返回值
第i个无效密码
rspec./spec/models/user_spec.rb:50#验证方法w的用户返回值
第i个无效密码'
在跟踪错误时

`attr_accessible` is extracted out of Rails into a gem. Please
 use new recommended protection model for params(strong_parameters) 
 or add `protected_attributes` to your Gemfile to use old one.

不要在Rails 4中使用
attr\u accessible

现在,attr\u accessible out允许我启动到heroku,但现在我在rspec测试中出现错误。请在我的原始帖子中查看。我看不到你的
规范
它与你的问题无关。我不应该以这种方式提出一个全新的问题吗?我修理了一件东西,但它弄坏了另一件。