TEA-ebook / teabook-open-reader

TeaBook Open Reader - EPUB web reader, with offline access
Other
127 stars 32 forks source link

Can't run rspec just after install with vagrant #25

Open julien-duponchelle opened 11 years ago

julien-duponchelle commented 11 years ago

Hi,

I install TEA with Vagrant:

vagrant up
vagrant ssh
./teabook/script/vagrant/start.sh

This work without problem, but rspec doesn't work:

vagrant@precise64:~/teabook$ bundle exec rspec
/home/vagrant/gem/gems/mongoid-2.4.12/lib/mongoid/railtie.rb:83:in `block in <class:Railtie>': undefined method `values' for nil:NilClass (NoMethodError)
    from /home/vagrant/gem/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `instance_exec'
    from /home/vagrant/gem/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `run'
    from /home/vagrant/gem/gems/railties-3.2.8/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /home/vagrant/gem/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `each'
    from /home/vagrant/gem/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `run_initializers'
    from /home/vagrant/gem/gems/railties-3.2.8/lib/rails/application.rb:136:in `initialize!'
    from /home/vagrant/gem/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /vagrant/config/environment.rb:29:in `<top (required)>'
    from /vagrant/spec/spec_helper.rb:31:in `require'
    from /vagrant/spec/spec_helper.rb:31:in `<top (required)>'
    from /vagrant/spec/controllers/admin/booksellers_controller_spec.rb:24:in `require'
    from /vagrant/spec/controllers/admin/booksellers_controller_spec.rb:24:in `<top (required)>'
    from /home/vagrant/gem/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `load'
    from /home/vagrant/gem/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `block in load_spec_files'
    from /home/vagrant/gem/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `map'
    from /home/vagrant/gem/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `load_spec_files'
    from /home/vagrant/gem/gems/rspec-core-2.10.1/lib/rspec/core/command_line.rb:22:in `run'
    from /home/vagrant/gem/gems/rspec-core-2.10.1/lib/rspec/core/runner.rb:69:in `run'
    from /home/vagrant/gem/gems/rspec-core-2.10.1/lib/rspec/core/runner.rb:10:in `block in autorun'
Coverage report generated for RSpec to /vagrant/coverage. 0 / 0 LOC (0.0%) covered.```

I think it's a simple and stupid configuration issues.
eunomie commented 11 years ago

I think this is just a problem with the mongoid configuration. In the installation script, the config is created with:

cp config/mongoid/development.yml config/mongoid.yml

and only contains a development part. But rspec needs, if I remember well, a test.

You can add lines by hand, or create a more complete configuration using the following task:

bundle exec rails g mongoid:config

Hope this can help.

julien-duponchelle commented 11 years ago

Yes perfect. I open a pull request to fix that #26.

Now i got this error:

/vagrant/lib/tea_api.rb:24:in `<top (required)>': TeaApi is not a class (TypeError)
    from /home/vagrant/gem/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
    from /home/vagrant/gem/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
    from /home/vagrant/gem/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /home/vagrant/gem/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
    from /vagrant/spec/controllers/tea_api_controller_spec.rb:23:in `<top (required)>'
    from /home/vagrant/gem/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `load'
    from /home/vagrant/gem/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `block in load'
    from /home/vagrant/gem/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /home/vagrant/gem/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `load'
    from /home/vagrant/gem/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `block in load_spec_files'
    from /home/vagrant/gem/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `map'
    from /home/vagrant/gem/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `load_spec_files'
    from /home/vagrant/gem/gems/rspec-core-2.10.1/lib/rspec/core/command_line.rb:22:in `run'
    from /home/vagrant/gem/gems/rspec-core-2.10.1/lib/rspec/core/runner.rb:69:in `run'
    from /home/vagrant/gem/gems/rspec-core-2.10.1/lib/rspec/core/runner.rb:10:in `block in autorun'