RailsApps / rails3-devise-rspec-cucumber

An example Rails 3.2 app with Devise and RSpec and Cucumber.
http://railsapps.github.io/
444 stars 144 forks source link

rspec failing: undefined method `before' for main:Object (NoMethodError) #27

Closed hannesfostie closed 12 years ago

hannesfostie commented 12 years ago

Full log pasted here: http://pastebin.com/4L6ywdev

I created the base app using your tutorial, so I hope it's not a mistake on my end. Regarding email_spec, I got a warning saying it was required outside of env.rb (which it shouldn't be). I resolved this by adding "require: false" to my Gemfile. This solution was found here: http://datacodescotch.blogspot.com/2011/11/warning-cucumber-rails-required-outside.html

DanielKehoe commented 12 years ago

What happens if you clone the example app from the repo (instead of using the version you created following the tutorial)? The repo version is canonical, do you get the same error? If not, can you do a file compare and identify what might be different in your implementation?

hannesfostie commented 12 years ago

Not sure how I would do a file compare, if it's simple feel free to give an example. I was indeed going to clone the start app and try again in case the error didn't seem familiar to you. Will keep you posted

DanielKehoe commented 12 years ago

Please revisit the tutorial and read the section entitled "Before You Start": "If you follow this tutorial closely, you’ll have a working application that closely matches the example app in this GitHub repository. The example app in the rails3-devise-rspec-cucumber repository is your reference implementation. If you find problems with the app you build from this tutorial, download the example app (in Git speak, clone it) and use a file compare tool to identify differences that may be causing errors. On a Mac, good file compare tools are FileMerge, DiffMerge, Kaleidoscope, or Ian Baird’s Changes." I don't what file compare tools are available for Windows but I'm sure you can find them.

DanielKehoe commented 12 years ago

Just took a look at your profile... welcome to the Rails community! I see you are working hard to gain mastery and I hope you are enjoying the learning process.

hannesfostie commented 12 years ago

Thank you!

Currently downloading ubuntu, even using the app templates was a major pain in the ass on windows because of the lack of libv8...

DanielKehoe commented 12 years ago

Be sure to look at my article on "installing Rails": http://railsapps.github.com/installing-rails.html

And check out Installing Rails on Ubuntu from Railsbridge Installfest: http://installfest.railsbridge.org/installfest/ubuntu

Success with Rails is all about finding the right resources.

albertoleal commented 12 years ago

This issue happens when you put the file "email_spec.rb", which requires 'email_spec/cucumber', under spec/support instead of feature/support.

DanielKehoe commented 12 years ago

Thanks for identifying the error. I've updated the tutorial for greater clarity.