theLemcke
2009-Sep-02 22:03 UTC
[rspec-users] undefined local variable or method `__FILE''
I ran this install guide: http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-rails-and-postgresql-on-os-x-third-edition Then generated a rails app, and ran ''script/generate rspec'' and ''script/generate rspec_model Note'' When I try to spec note_spec.rb I get this error: /Users/sixtimesnine/Rails/TestApps/NotesApp/spec/spec_helper.rb:13: undefined local variable or method `__FILE'' for main:Object (NameError) from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/ custom_require.rb:31:in `gem_original_require'' from /opt/local/lib/ ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `require'' from / Users/sixtimesnine/Rails/TestApps/NotesApp/spec/models/note_spec.rb:1 from /Users/sixtimesnine/Rails/TestApps/NotesApp/vendor/plugins/rspec/ lib/spec/runner/example_group_runner.rb:15:in `load'' from /Users/ sixtimesnine/Rails/TestApps/NotesApp/vendor/plugins/rspec/lib/spec/ runner/example_group_runner.rb:15:in `load_files'' from /Users/ sixtimesnine/Rails/TestApps/NotesApp/vendor/plugins/rspec/lib/spec/ runner/example_group_runner.rb:14:in `each'' from /Users/sixtimesnine/ Rails/TestApps/NotesApp/vendor/plugins/rspec/lib/spec/runner/ example_group_runner.rb:14:in `load_files'' from /Users/sixtimesnine/ Rails/TestApps/NotesApp/vendor/plugins/rspec/lib/spec/runner/ options.rb:107:in `run_examples'' from /Users/sixtimesnine/Rails/ TestApps/NotesApp/vendor/plugins/rspec/lib/spec/runner/command_line.rb: 9:in `run'' from /Users/sixtimesnine/Library/Application Support/ TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/../spec/mate/ runner.rb:37:in `run'' from /Users/sixtimesnine/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/../spec/mate/ runner.rb:36:in `chdir'' from /Users/sixtimesnine/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/../spec/mate/ runner.rb:36:in `run'' from /Users/sixtimesnine/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/../spec/mate/ runner.rb:14:in `run_file'' from /tmp/textmate-command-320.rb:3 Any clues?
theLemcke
2009-Sep-02 22:22 UTC
[rspec-users] undefined local variable or method `__FILE''
So I began with this setup: http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-rails-and-postgresql-on-os-x-third-edition Created a basic rails setup, ran ''script/generate rspec'' and ''script/ generate rspec_model Note'' and tried to run ''note_spec.rb'' and I encountered this error: /Users/sixtimesnine/Rails/TestApps/NotesApp/spec/spec_helper.rb:13: undefined local variable or method `__FILE'' for main:Object (NameError) from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/ custom_require.rb:31:in `gem_original_require'' from /opt/local/lib/ ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `require'' from / Users/sixtimesnine/Rails/TestApps/NotesApp/spec/models/note_spec.rb:1 from /Users/sixtimesnine/Rails/TestApps/NotesApp/vendor/plugins/rspec/ lib/spec/runner/example_group_runner.rb:15:in `load'' from /Users/ sixtimesnine/Rails/TestApps/NotesApp/vendor/plugins/rspec/lib/spec/ runner/example_group_runner.rb:15:in `load_files'' from /Users/ sixtimesnine/Rails/TestApps/NotesApp/vendor/plugins/rspec/lib/spec/ runner/example_group_runner.rb:14:in `each'' from /Users/sixtimesnine/ Rails/TestApps/NotesApp/vendor/plugins/rspec/lib/spec/runner/ example_group_runner.rb:14:in `load_files'' from /Users/sixtimesnine/ Rails/TestApps/NotesApp/vendor/plugins/rspec/lib/spec/runner/ options.rb:107:in `run_examples'' from /Users/sixtimesnine/Rails/ TestApps/NotesApp/vendor/plugins/rspec/lib/spec/runner/command_line.rb: 9:in `run'' from /Users/sixtimesnine/Library/Application Support/ TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/../spec/mate/ runner.rb:37:in `run'' from /Users/sixtimesnine/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/../spec/mate/ runner.rb:36:in `chdir'' from /Users/sixtimesnine/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/../spec/mate/ runner.rb:36:in `run'' from /Users/sixtimesnine/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/../spec/mate/ runner.rb:14:in `run_file'' from /tmp/textmate-command-335.rb:3 Sorry if this is a double post
David Chelimsky
2009-Sep-02 22:28 UTC
[rspec-users] undefined local variable or method `__FILE''
On Wed, Sep 2, 2009 at 5:22 PM, theLemcke<sixtimesnine at gmail.com> wrote:> So I began with this setup: > http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-rails-and-postgresql-on-os-x-third-edition > > Created a basic rails setup, ran ''script/generate rspec'' and ''script/ > generate rspec_model Note'' and tried to run ''note_spec.rb'' and I > encountered this error: > > /Users/sixtimesnine/Rails/TestApps/NotesApp/spec/spec_helper.rb:13: > undefined local variable or method `__FILE'' for main:ObjectThis was a typo that was in a commit but not in a release - not sure how you ended up with it - but search for __FILE (without the trailing __). HTH> (NameError) from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/ > custom_require.rb:31:in `gem_original_require'' from /opt/local/lib/ > ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `require'' from / > Users/sixtimesnine/Rails/TestApps/NotesApp/spec/models/note_spec.rb:1 > from /Users/sixtimesnine/Rails/TestApps/NotesApp/vendor/plugins/rspec/ > lib/spec/runner/example_group_runner.rb:15:in `load'' from /Users/ > sixtimesnine/Rails/TestApps/NotesApp/vendor/plugins/rspec/lib/spec/ > runner/example_group_runner.rb:15:in `load_files'' from /Users/ > sixtimesnine/Rails/TestApps/NotesApp/vendor/plugins/rspec/lib/spec/ > runner/example_group_runner.rb:14:in `each'' from /Users/sixtimesnine/ > Rails/TestApps/NotesApp/vendor/plugins/rspec/lib/spec/runner/ > example_group_runner.rb:14:in `load_files'' from /Users/sixtimesnine/ > Rails/TestApps/NotesApp/vendor/plugins/rspec/lib/spec/runner/ > options.rb:107:in `run_examples'' from /Users/sixtimesnine/Rails/ > TestApps/NotesApp/vendor/plugins/rspec/lib/spec/runner/command_line.rb: > 9:in `run'' from /Users/sixtimesnine/Library/Application Support/ > TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/../spec/mate/ > runner.rb:37:in `run'' from /Users/sixtimesnine/Library/Application > Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/../spec/mate/ > runner.rb:36:in `chdir'' from /Users/sixtimesnine/Library/Application > Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/../spec/mate/ > runner.rb:36:in `run'' from /Users/sixtimesnine/Library/Application > Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/../spec/mate/ > runner.rb:14:in `run_file'' from /tmp/textmate-command-335.rb:3 > > Sorry if this is a double post > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
theLemcke
2009-Sep-03 00:37 UTC
[rspec-users] undefined local variable or method `__FILE''
Thanks a lot, that fixed it. Sorry about the double post, btw. On Sep 2, 3:03?pm, theLemcke <sixtimesn... at gmail.com> wrote:> I ran this install guide:http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-ra... > > Then generated a rails app, and ran ''script/generate rspec'' and > ''script/generate rspec_model Note'' > > When I try to spec note_spec.rb I get this error: > > /Users/sixtimesnine/Rails/TestApps/NotesApp/spec/spec_helper.rb:13: > undefined local variable or method `__FILE'' for main:Object > (NameError) from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/ > custom_require.rb:31:in `gem_original_require'' from /opt/local/lib/ > ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `require'' from / > Users/sixtimesnine/Rails/TestApps/NotesApp/spec/models/note_spec.rb:1 > from /Users/sixtimesnine/Rails/TestApps/NotesApp/vendor/plugins/rspec/ > lib/spec/runner/example_group_runner.rb:15:in `load'' from /Users/ > sixtimesnine/Rails/TestApps/NotesApp/vendor/plugins/rspec/lib/spec/ > runner/example_group_runner.rb:15:in `load_files'' from /Users/ > sixtimesnine/Rails/TestApps/NotesApp/vendor/plugins/rspec/lib/spec/ > runner/example_group_runner.rb:14:in `each'' from /Users/sixtimesnine/ > Rails/TestApps/NotesApp/vendor/plugins/rspec/lib/spec/runner/ > example_group_runner.rb:14:in `load_files'' from /Users/sixtimesnine/ > Rails/TestApps/NotesApp/vendor/plugins/rspec/lib/spec/runner/ > options.rb:107:in `run_examples'' from /Users/sixtimesnine/Rails/ > TestApps/NotesApp/vendor/plugins/rspec/lib/spec/runner/command_line.rb: > 9:in `run'' from /Users/sixtimesnine/Library/Application Support/ > TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/../spec/mate/ > runner.rb:37:in `run'' from /Users/sixtimesnine/Library/Application > Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/../spec/mate/ > runner.rb:36:in `chdir'' from /Users/sixtimesnine/Library/Application > Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/../spec/mate/ > runner.rb:36:in `run'' from /Users/sixtimesnine/Library/Application > Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/../spec/mate/ > runner.rb:14:in `run_file'' from /tmp/textmate-command-320.rb:3 > > Any clues? > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users