railstutorial.org

Missing required arguments: aws_access_key_id, aws_secret_access_key on rake test

泄露秘密 提交于 2019-12-13 00:27:47
问题 I'm doing chapter 11 of hartle's tutorial. When I ran heroku run rake db:migrate I got this error: Missing required arguments: aws_access_key_id, aws_secret_access_key I solved it with the answer in enter link description here and migrate successfully.but now when I run bundle exec rake test It gives me: rake aborted! ArgumentError: Missing required arguments: aws_access_key_id, aws_secret_access_key This is my carrierwave file: CarrierWave.configure do |config| config.fog_credentials = {

RailsTutorial 3.2 Ch 9 - “before { valid_signin(user) }” causes RSpec test to fail

家住魔仙堡 提交于 2019-12-13 00:02:27
问题 I'm currently in RailsTutorial 3.2, Section 9.3.1 User Index. Listing 9.27 directs an edit to the spec/requests/authentication_pages_spec.rb code as follows: require 'spec_helper' describe "Authentication" do . . . describe "with valid information" do let(:user) { FactoryGirl.create(:user) } before { valid_signin(user) } it { should have_selector('title', text: user.name) } it { should have_link('Users', href: users_path) } it { should have_link('Profile', href: user_path(user)) } it { should

Rails Tutorial Chapter 8 - undefined local variable or method `signin_path'

谁都会走 提交于 2019-12-12 22:27:05
问题 I'm getting the following rSpec failed tests error. What did I do wrong? Many thanks.. 1) Authentication signin page Failure/Error: before { visit signin_path } NameError: undefined local variable or method signin_path' for # # ./spec/requests/authentication_pages_spec.rb:8:inblock (3 levels) in ' 2) Authentication signin page Failure/Error: before { visit signin_path } NameError: undefined local variable or method signin_path' for # # ./spec/requests/authentication_pages_spec.rb:8:inblock (3

AWS S3 IAM policy for read and write permissions on a single bucket

邮差的信 提交于 2019-12-12 19:35:58
问题 In Chapter 11.4.4 'Image upload in production' of Michael Hartl' Rails Tutorial it is suggested to use Amazon Web Services S3 as a cloud storage service. In a note at the bottom of the page, the author himself defines this section of the book as "challenging" and also suggests that it "can be skipped without loss of continuity". Indeed one of the most challenging parts of this section is to find a suitable IAM policy that can be attached to the IAM user at AWS in order to grant to the IAM

Unable to run rails server: `require': cannot load such file — net/ssh (LoadError)

谁说胖子不能爱 提交于 2019-12-12 18:53:33
问题 I am trying to learn ruby on rails using the michael hartl guide. In the past, I was able to get through the setup of a new rails webapp. Now, when I try to run the server, I am getting this error: /home/ss/.rvm/gems/ruby-2.2.2/gems/fog-1.26.0/lib/fog/joyent/compute.rb:3:in `require': cannot load such file -- net/ssh (LoadError) from /home/ss/.rvm/gems/ruby-2.2.2/gems/fog-1.26.0/lib/fog/joyent/compute.rb:3:in `<top (required)>' from /home/ss/.rvm/gems/ruby-2.2.2/gems/fog-1.26.0/lib/fog/joyent

Using shoulda to refactor rspec tests on Rails models

岁酱吖の 提交于 2019-12-12 07:46:49
问题 After learning about shoulda-matchers by answering another StackOverflow question on attribute accessibility tests (and thinking they were pretty awesome), I decided to try refactoring the model tests I did in The Rails Tutorial in an attempt to make them even more concise and thorough. I did this thanks to some inspiration from the documentation for modules Shoulda::Matchers::ActiveRecord and Shoulda::Matchers::ActiveModel, as well as this StackOverflow answer on structuring shoulda tests in

Ruby on Rails Michael Hartl chapter 8.5 Test Fails

时间秒杀一切 提交于 2019-12-12 03:52:09
问题 I've seen this question asked another time, in which the current_user variable was defined twice. I had the same error in my code, however removing the second definition of current_user still does not resolve the error message that I am receiving. This is the error message that I get when running my test: 1) Failure: SessionsHelperTest#test_current_user_returns_right_user_when_session_is_nil [/home/ubuntu/workspace/sample_app/test/helpers/sessions_helper_test.rb:11]: --- expected +++ actual @

Rails Tutorial chapter 10.3.3 - 4 RSpec Errors (app working)

守給你的承諾、 提交于 2019-12-12 01:27:45
问题 I'm getting 4 RSpec errors that have something to do with the Will-Paginate gem, but for the life of me, I cant figure out what they're pointing at. The app works fine though. Failures: 1) UsersController GET 'index' for signed-in users should be successful Failure/Error: get :index NoMethodError: undefined method `paginate' for #<Class:0x9580710> # ./app/controllers/users_controller.rb:7:in `index' # ./spec/controllers/users_controller_spec.rb:30:in `block (4 levels) in <top (required)>' 2)

RailsTutorial.org - ExecJS::RuntimeError in Users#index [duplicate]

主宰稳场 提交于 2019-12-11 23:33:08
问题 This question already has answers here : ExecJS::RuntimeError in Users#index (RoR) (8 answers) Closed 5 years ago . I am following the Ruby on Rails tutorial by Michael Hartl and in the second chapter, a demo app is setup. I am up against an error and I am not able to find the cause!! I made sure that I followed every command that was in the tutorial: Ran rails new to demo_app create the project Updated the gem file as was required Executed rails generate scaffold User name:string email

Failure/Error: sign_in user undefined method `sign_in'

二次信任 提交于 2019-12-11 20:58:57
问题 I'm stuck at Chapter 9 in the Rails tutorial - more specifically at the end of section 9.1. My problem is similar to the one in this thread but the solution there didn't work for me. Here is my user_pages_spec.rb: require 'spec_helper' describe "User pages" do subject { page } describe "signup page" do before { visit signup_path } it { should have_content('Sign up') } it { should have_title(full_title('Sign up')) } end describe "profile page" do let (:user) {FactoryGirl.create(:user)} before