I get the following error when I am trying to set this up. I can't figure out what's going on. I'm following Michael Hartl's Rail's tutorial trying to set up for first tests and nothing seems to be working.
C:\rails_projects\sample_app>bundle exec autotest
loading autotest/rspec2
C:/rails_projects/sample_app/.autotest:1:in `require': cannot load such file -- autotest/growl (LoadError)
from C:/rails_projects/sample_app/.autotest:1:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/ZenTest-4.7.0/lib/autotest.rb:315:in `load'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/ZenTest-4.7.0/lib/autotest.rb:315:in `block in initialize'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/ZenTest-4.7.0/lib/autotest.rb:314:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/ZenTest-4.7.0/lib/autotest.rb:314:in `initialize'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.9.0/lib/autotest/rspec2.rb:13:in `initialize'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/ZenTest-4.7.0/lib/autotest.rb:244:in `new'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/ZenTest-4.7.0/lib/autotest.rb:244:in `run'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/ZenTest-4.7.0/bin/autotest:6:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/bin/autotest:19:in `load'
from C:/RailsInstaller/Ruby1.9.3/bin/autotest:19:in `<main>'
you, probably have a configuration for use growl on your .autotest file.
I think you may need add on your Gemfile the following line:
gem "autotest-growl"
Related
I'm trying to create a new app using rails-api. When I run rails-api new mynewapp I get the following:
/Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1.1/lib/thor/parser/option.rb:125:in `validate_default_type!': An option's default must match its type. (ArgumentError)
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1.1/lib/thor/parser/option.rb:111:in `validate!'
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1.1/lib/thor/parser/argument.rb:24:in `initialize'
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1.1/lib/thor/parser/option.rb:9:in `initialize'
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1.1/lib/thor/base.rb:544:in `new'
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1.1/lib/thor/base.rb:544:in `build_option'
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1.1/lib/thor/base.rb:274:in `class_option'
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/generators/base.rb:202:in `class_option'
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/generators/app_base.rb:71:in `add_shared_options_for'
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/generators/rails/app/app_generator.rb:160:in `<class:AppGenerator>'
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/generators/rails/app/app_generator.rb:159:in `<module:Generators>'
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/generators/rails/app/app_generator.rb:153:in `<module:Rails>'
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/generators/rails/app/app_generator.rb:3:in `<top (required)>'
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rails-api-0.4.0/lib/rails-api/generators/rails/app/app_generator.rb:2:in `<top (required)>'
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rails-api-0.4.0/bin/rails-api:3:in `<top (required)>'
from /Users/sandy/.rbenv/versions/2.2.2/bin/rails-api:23:in `load'
from /Users/sandy/.rbenv/versions/2.2.2/bin/rails-api:23:in `<main>'
I get the exact same error when trying rails new mynewapp, except instead of
...gems/rails-api-0.4.0/bin/rails-api:3:in `<top (required)>'
I get
...gems/railties-4.2.4/bin/rails:9:in `<top (required)>'
And even running rails -v gives the same error.
Google was no help. Does anyone have any idea what might causing this?
If you run rails -v and get an error, your installation is probably bad. I'd try re-installing rails...
Follow this:
http://installrails.com/
It looks like thor 0.19.1.1 made a breaking change. Try changing it to 0.19.1 and see if that fixes the issue.
Working through Michael Hartle's tutorial and I cannot execute RSpec; terminal is presenting with the following error:
/Users/coreymkimball/Canvi/Tutorials/sample_app/spec/requests/static_pages_spec.rb:1:in `require': cannot load such file -- spec-helper (LoadError)
from /Users/coreymkimball/Canvi/Tutorials/sample_app/spec/requests/static_pages_spec.rb:1:in `<top (required)>'
from /Users/coreymkimball/.rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `load'
from /Users/coreymkimball/.rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `block in load_spec_files'
from /Users/coreymkimball/.rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `each'
from /Users/coreymkimball/.rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `load_spec_files'
from /Users/coreymkimball/.rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/rspec-core-2.13.1/lib/rspec/core/command_line.rb:22:in `run'
from /Users/coreymkimball/.rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:80:in `run'
from /Users/coreymkimball/.rvm/gems/ruby-2.0.0-p247#railstutorial_rails_4_0/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:17:in `block in autorun'
It states that there has been a load error in the particular file; not sure how to go about creating a new one, or getting over this troubleshooting hurdle. Any help would be great.
You'll likely find that the file you made in your spec directory is called spec_helper, not spec-helper. Change the require at the top of your static_pages_spec.rb to reflect this.
i'm trying to move my rails app from ubuntu to osx. when running rspec, i get the following obscure error:
/Users/josh/dev/myproject/spec/support/devise.rb:3:in `block in <top (required)>': uninitialized constant RequestHelpers (NameError)
from /Users/josh/.rvm/gems/ruby-1.9.3-p286#myproject/gems/rspec-core-2.11.1/lib/rspec/core.rb:92:in `configure'
from /Users/josh/dev/myproject/spec/support/devise.rb:1:in `<top (required)>'
from /Users/josh/dev/myproject/spec/spec_helper.rb:21:in `block (2 levels) in <top (required)>'
from /Users/josh/dev/myproject/spec/spec_helper.rb:21:in `each'
from /Users/josh/dev/myproject/spec/spec_helper.rb:21:in `block in <top (required)>'
from /Users/josh/.rvm/gems/ruby-1.9.3-p286#myproject/gems/spork-0.9.2/lib/spork.rb:24:in `prefork'
from /Users/josh/dev/myproject/spec/spec_helper.rb:4:in `<top (required)>'
from /Users/josh/dev/myproject/spec/controllers/comments_controller_spec.rb:1:in `require'
from /Users/josh/dev/myproject/spec/controllers/comments_controller_spec.rb:1:in `<top (required)>'
from /Users/josh/.rvm/gems/ruby-1.9.3-p286#myproject/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `load'
from /Users/josh/.rvm/gems/ruby-1.9.3-p286#myproject/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `block in load_spec_files'
from /Users/josh/.rvm/gems/ruby-1.9.3-p286#myproject/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `map'
from /Users/josh/.rvm/gems/ruby-1.9.3-p286#myproject/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `load_spec_files'
from /Users/josh/.rvm/gems/ruby-1.9.3-p286#myproject/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:22:in `run'
from /Users/josh/.rvm/gems/ruby-1.9.3-p286#myproject/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:66:in `rescue in run'
from /Users/josh/.rvm/gems/ruby-1.9.3-p286#myproject/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:62:in `run'
from /Users/josh/.rvm/gems/ruby-1.9.3-p286#myproject/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in `block in autorun'
everything works nicely in Ubuntu, so i guess it must be environmental. Any ideas where to start digging?
thanks
- Josh
EDIT: no idea why, but the file request_helpers.rb could not be found by rake. moving it elsewhere resolved the issue.
This hardly seems an operating system problem, much rather a matter of configuration. Make sure your environemnt is the same in terms of:
using rvm installed the same way
having all the needed gems in the Gemfile
using bundle to execute rspec
using the same version of everything.
By te way this is not an obscure message, it's in fact pretty clear:
uninitialized constant RequestHelpers (NameError)
so the spec/support/devise.rb file can't find the needed class.
Have you written that file? If not, how did you generate it? Repeat the procedure to generate it (probably rake something or rails generate something) and it will be OK.
So, long story short, I had o format and reinstall my OS hence all my dev utilities.
git env sorted.
DevKit was fine.
Sphinx/mysql fine.
Bundle installed perfectly.
Everything is gravy until I go to rake db:create and build my database.
Environment:
OS: Win7 64-bit
Ruby192
gem -v 1.8.24
rails 3.1.3
Now the problem, when I rake anything I get a pop-up window
ruby.exe - Entry Point Not Found
The procedure entry point rb_class_superclass could not be located in the dynamic link library msvcrt-ruby191.dll
I've tried clean installing ruby, clearing the gems and reinstalling. Stuck on what to do next.
trace output:
rake aborted!
no such file to load -- ruby/prof
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:74:in `require'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:74:in `rescue in block in require'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:62:in `block in require'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in `each'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in `require'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler.rb:119:in `require'
E:/Documents/Websites/rails-app /trunk/config/application.rb:7:in `<top (required)>'
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
E:/Documents/Websites/rails-app/trunk/Rakefile:4:in `<top (required)>'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load_rakefile'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:501:in `raw_load_rakefile'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:82:in `block in load_rakefile'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:81:in `load_rakefile'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:65:in `block in run'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
C:/Ruby192/bin/rake:23:in `load'
C:/Ruby192/bin/rake:23:in `<main>'
I've seen similar issues raised but for different lines in the dll and relating to sqlite3. I'm not using sqlite3 at all though. I'm on mysql with the mysql2 connector.
Any help?
I think I figured this out.
In the gemfile I replaced:
gem "ruby-prof"
with:
gem "ruby-prof", "0.10.8"
and all of a sudden I was rolling onto the next issue, which was specifying my rake version. I think both issues are related to an incompatability between the gems and my rubygems verson (I'm guessing??). This is the only difference I could see between my laptop environment, my desktop environment and my production server.
Either way. Sorted!
HI all I just recently installed rvm and all that good stuff on my macbook air and I started my rails 3.1.1 app with ruby 1.9.3. In my gem file I put down guard and rspec, now when I try and run rspec by itself or with guard I get errors thrown at me and I'm not sure why,
the output I get when I run is such,
phantom:tasks maxmarze$ guard
Please install rb-fsevent gem for Mac OSX FSEvents support
Using polling (Please help us to support your system better than that).
Please install growl_notify or growl gem for Mac OS X notification support and add it to your Gemfile
Guard is now watching at '/Users/maxmarze/rails_projects/tasks'
Guard::RSpec is running, with RSpec 2!
Running all specs
/Users/maxmarze/rails_projects/tasks/spec/requests/tasks_spec.rb:1:in `require': cannot load such file -- spec_helper (LoadError)
from /Users/maxmarze/rails_projects/tasks/spec/requests/tasks_spec.rb:1:in `<top (required)>'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `load'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `block in load_spec_files'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `map'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `load_spec_files'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/command_line.rb:18:in `run'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:80:in `run_in_process'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:69:in `run'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:10:in `block in autorun'
Guard::RSpec is running, with RSpec 2!
Running all specs
/Users/maxmarze/rails_projects/tasks/spec/requests/tasks_spec.rb:1:in `require': cannot load such file -- spec_helper (LoadError)
from /Users/maxmarze/rails_projects/tasks/spec/requests/tasks_spec.rb:1:in `<top (required)>'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `load'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `block in load_spec_files'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `map'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `load_spec_files'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/command_line.rb:18:in `run'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:80:in `run_in_process'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:69:in `run'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:10:in `block in autorun'
and when I run it just with normal rspec commands or using bundle's bundle exec rspec spec/requests/tasks_spec.rb I get this output,
/Users/maxmarze/rails_projects/tasks/spec/requests/tasks_spec.rb:1:in `require': cannot load such file -- spec_helper (LoadError)
from /Users/maxmarze/rails_projects/tasks/spec/requests/tasks_spec.rb:1:in `<top (required)>'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `load'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `block in load_spec_files'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `map'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `load_spec_files'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/command_line.rb:18:in `run'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:80:in `run_in_process'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:69:in `run'
from /Users/maxmarze/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:10:in `block in autorun'
Needless to say I'm at a lose and have no clue why it is throwing me these errors, I've never had these problems before.
Checkout /Users/maxmarze/rails_projects/tasks/spec/spec_helper.rb, I think you forgot rails generate rspec:install