jejacks0n / teaspoon

Teaspoon: Javascript test runner for Rails. Use Selenium, BrowserStack, or PhantomJS.
1.43k stars 243 forks source link

Exception raised: uninitialized constant Teaspoon::Formatters #325

Closed ptrhvns closed 9 years ago

ptrhvns commented 9 years ago

I'm getting the exception below when I try to install teaspoon from the root path of a Rails engine. Some of the software versions I'm using are:

Here's the exception:

$ rails generate teaspoon:install

(erb):142:in `template': uninitialized constant Teaspoon::Formatters (NameError)
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/2.2.0/erb.rb:863:in `eval'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/2.2.0/erb.rb:863:in `result'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions/file_manipulation.rb:116:in `block in template'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:53:in `call'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:53:in `render'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:46:in `identical?'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:72:in `on_conflict_behavior'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions/empty_directory.rb:113:in `invoke_with_conflict_check'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:60:in `invoke!'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions.rb:94:in `action'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:25:in `create_file'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions/file_manipulation.rb:115:in `template'
        from /Users/$USER/.rbenv/versions/2.2.0/gemsets/online_auth/gems/teaspoon-0.9.1/lib/generators/teaspoon/install/install_generator.rb:43:in `copy_environment'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from /Users/$USER/.rbenv/versions/2.2.0/gemsets/online_auth/gems/railties-4.1.6/lib/rails/generators.rb:157:in `invoke'
        from /Users/$USER/.rbenv/versions/2.2.0/gemsets/online_auth/gems/railties-4.1.6/lib/rails/commands/generate.rb:11:in `<top (required)>'
        from /Users/$USER/.rbenv/versions/2.2.0/gemsets/online_auth/gems/railties-4.1.6/lib/rails/engine/commands.rb:19:in `<top (required)>'
        from script/rails:8:in `require'
        from script/rails:8:in `<main>'
jejacks0n commented 9 years ago

Are you requiring teaspoon in your gemfile, and if so, in which groups? it needs to be in :development and :test.

jejacks0n commented 9 years ago

ah, interesting.. I think I know why, which seems like it's not a new issue.

jejacks0n commented 9 years ago

Can you let me know if this is fixed? It's really difficult to have a test for this kind of case.

ptrhvns commented 9 years ago

@jejacks0n I have teaspoon the Gemfile like this:

# ...
gem 'teaspoon', '= 0.9.1', group: [:development, :test]
# ...
ptrhvns commented 9 years ago

@jejacks0n I'll try to install the commit above and test as soon as I get a chance, and I'll post the result of that test here.

ptrhvns commented 9 years ago

@jejacks0n Hmm, looks like I'm still getting the error:

$ grep teaspoon Gemfile
gem 'teaspoon', git: 'git@github.com:modeset/teaspoon.git', ref: '825fd6b'

$ bundle show teaspoon
/Users/$USER/.rbenv/versions/2.2.0/gemsets/$GEMSET/bundler/gems/teaspoon-825fd6b2c29d

$ bundle exec rails g teaspoon:install
      create  spec/teaspoon_env.rb
(erb):142:in `template': uninitialized constant Teaspoon::Formatters (NameError)
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/2.2.0/erb.rb:863:in `eval'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/2.2.0/erb.rb:863:in `result'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions/file_manipulation.rb:116:in `block in template'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:53:in `call'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:53:in `render'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:62:in `block (2 levels) in invoke!'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:62:in `open'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:62:in `block in invoke!'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions/empty_directory.rb:116:in `call'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions/empty_directory.rb:116:in `invoke_with_conflict_check'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:60:in `invoke!'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions.rb:94:in `action'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:25:in `create_file'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/actions/file_manipulation.rb:115:in `template'
        from /Users/$USER/.rbenv/versions/2.2.0/gemsets/$GEMSET/bundler/gems/teaspoon-825fd6b2c29d/lib/generators/teaspoon/install/install_generator.rb:43:in `copy_environment'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
        from /Users/$USER/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from /Users/$USER/.rbenv/versions/2.2.0/gemsets/$GEMSET/gems/railties-4.1.6/lib/rails/generators.rb:157:in `invoke'
        from /Users/$USER/.rbenv/versions/2.2.0/gemsets/$GEMSET/gems/railties-4.1.6/lib/rails/commands/generate.rb:11:in `<top (required)>'
        from /Users/$USER/.rbenv/versions/2.2.0/gemsets/$GEMSET/gems/railties-4.1.6/lib/rails/engine/commands.rb:19:in `<top (required)>'
        from script/rails:8:in `require'
        from script/rails:8:in `<main>'