railstutorial.org

Error with autotest in ruby on rails

梦想的初衷 提交于 2019-12-10 15:15:56
问题 I ran the command autotest and this is the error I got . I am following Hartl's book and was wondering is this clash happening because rails now comes with ZenTest or something else ? How can I work past this error. I am new to RoR Invalid gemspec in [/Users//.rvm/gems/ruby-1.9.2-p320@twitclone/specifications/ZenTest-4.8.4.gemspec]: Illformed requirement ["< 2.1, >= 1.8"] Invalid gemspec in [/Users//.rvm/gems/ruby-1.9.2-p320@twitclone/specifications/ZenTest-4.8.4.gemspec]: Illformed

RSpec Error Regarding Selenium-Webdriver

两盒软妹~` 提交于 2019-12-10 14:56:28
问题 Trying to get through Michael Hartl's tutorial; encountering issues here. I've just created the application. Here is what I am presented with when I run 'bundle exec rspec spec/requests/static_pages_spec.rb' Corey-M-Kimball:sample_app coreymkimball$ bundle exec rspec spec/requests/static_pages_spec.rb /Users/coreymkimball/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/selenium-webdriver-2.0.0/lib/selenium/webdriver/common/zipper.rb:1:in `require': cannot load such file -- zip/zip

teaching myself rails deploying first app to heroku -failure to upload - sqlite3 and postgre glitch

房东的猫 提交于 2019-12-10 11:27:38
问题 Im teaching myself rails. Im a programmer but not a web programmer. Im going through Michael Hartl's book here It mentions that its a good idea to start deploying your app right from the beginning. I agree. So I got an account on Heroku and went through ther setup etc. Then created my 1st app, git and the works. Then followed all the instructions on Heroku's site. Finally I came to pushing my app up to Heroku using this command: git push heroku master The book says that there could be

Hartl Rail Tutorial: Chapter 5, exercise 3

删除回忆录丶 提交于 2019-12-10 11:27:34
问题 I'm trying to make sense of the last exercise in Chapter 5 of Hartl's Rails Tutorial but don't really understand it nor what it strives to do. My rationale: It speaks of "full_title helper", which refers to the code we placed in app/controllers/helpers/application_helper.rb: def full_title(page_title = '') base_title = "Ruby on Rails Tutorial Sample App" if page_title.empty? base_title else "#{page_title} | #{base_title}" end end The exercise is: 1) Include the above application_helper.rb

Password Reset Test failing in M.Hartl's Ruby on Rails Tutorial (3rd edition), Chapter 10 (10.54)

痴心易碎 提交于 2019-12-10 10:49:53
问题 All my tests/assertions have passed as expected up until now. I'm pretty confident that the application itself is working fine, but I'm failing one assertion in this test. I'm a Rails rookie, but I know from other programming experiences that not resolving this now is likely leaving a gremlin to fester. Out of respect for SO members' time (and recognizing my Rails-novice state) I have done just about everything humanly possible to troubleshoot before asking this question, including: Restarted

Testing views with will_paginate Gem using Capybara/Rspec

别来无恙 提交于 2019-12-10 10:47:50
问题 Doing Michael Hartl's Rails Tutorial, on chapter 10, section 5, exercise 2. I am - very simply - trying to write tests to ensure that a pagination div appears on a couple pages using the will_paginate gem (this seems to be Hartl's preferred method of testing whether pagination works), but when I add the following code.. subject { page } . . . it { should have_selector('div.pagination') } ..it returns.. 1) UserPages profile page Failure/Error: it { should have_selector('div.pagination') }

Rails Tutorial: RSpec test decoupling

让人想犯罪 __ 提交于 2019-12-09 16:39:40
问题 I'm trying to do Exercise 2 of Chapter 8.5 in Michael Hartl's Ruby on Rails Tutorial. The exercise is as follows: Following the example in Section 8.3.3, go through the user and authentication request specs (i.e., the files currently in the spec/requests directory) and define utility functions in spec/support/utilities.rb to decouple the tests from the implementation. Extra credit: Organize the support code into separate files and modules, and get everything to work by including the modules

Rails Tutorial Ch. 9 Exercise 6: Expected response to be a <redirect>, but was <200>

前提是你 提交于 2019-12-08 19:38:03
问题 I am trying to write tests and application code to redirect users who are already signed-in to the root_path if they try to CREATE a user or visit the NEW user path. Here are the tests I have written in user_pages_spec.rb: describe "for signed in users" do let(:user) { FactoryGirl.create(:user) } before { sign_in user } describe "using a 'new' action" do before { get new_user_path } specify { response.should redirect_to(root_path) } end describe "using a 'create' action" do before { post

Error- After Adding a Text Counter on Home Page ( Count remaining characters using Jquery)- require a refresh of Page

纵饮孤独 提交于 2019-12-08 13:01:50
问题 while going through the exercise on Railstutorial(chapter 10), i have used Jquery to count remaining characters in Textarea. It actually works but only, when i refresh my page for atleast one time per signin . that means query is not executing until the page is refreshed for one time after every signin and there after it is working perfectly. I have used css for .countdown method. So, my question is..why it is required me to refresh page to see remaining chars on the page and also, is there

Rails Tutorial sample_app fails in Heroku with log: ActionController::RoutingError (No route matches [GET] “/about”):

柔情痞子 提交于 2019-12-08 09:40:13
问题 I am following the online version of Rails Tutorial. The Sample_app in chapter 3 works fine locally, but when pushed to Heroku, the home page is found but not the other pages. Running heroku logs after trying to see the About page gives me (along with much else) the error above: 2015-08-09T02:56:43.916991+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/about"): My routes.rb file is Rails.application.routes.draw do root 'static_pages#home' get 'static_pages/help' get