I have a Rails app that runs on Phusion+Apache in the following environment:
RHEL 5 x64
Ruby 1.9.2 p290 x64
Rails 3.0.4
Rake 0.9.2.2
I'm using and Oracle 11g database so I've also installed:
activerecord-oracle_enhanced-adapter (1.4.0)
ruby-oci8 (2.0.6)
database.yml is correctly configured.
My application correctly runs in production mode.
The problem is when I try to run my tests with rake spec I have the following Warnings and then the rake process stops with no error message at all.
Here is the output:
alex#rhel:~/projects/app$ rake spec
WARNING: 'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
at /usr/local/lib/ruby/gems/1.9.1/lib/rake/rdoctask.rb
WARNING: Global access to Rake DSL methods is deprecated. Please include
... Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method Api::Application#task called at /usr/local/lib/ruby/gems/1.9.1/railties-3.0.4/lib/rails/application.rb:214:in `initialize_tasks'
alex#rhel:~/projects/app$
I've checked the exit code of the rake process and is set on 0 -> success.
Do you have any ideas ?
Thanks
These are deprecation warnings, informing you that some of the code you're calling has been deprecated.
Are your tests actually failing? Getting deprecation warnings doesn't mean you spec is failing. I see three dots ... Rake::DSL
Are those dots your passing specs? How many specs do you have?
Related
I use the command
rake doc:app
to generate some rudimentary documentation for my rails app. It's always worked fine in the past. Yesterday I upgraded by app from Ruby 1.9.3 to 2.1.1, and Rails 3.2 to 4.1. Everything is working fine with the app, so I went to regenerate documentation for the first time in a few weeks, and it failed. I ran the command above and got the following error message:
rake aborted!
Don't know how to build task 'README.rdoc'
/home/vagrant/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
/home/vagrant/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => doc:app => doc/app/index.html
(See full trace by running task with --trace)
I believe this is the standard error message rake delivers for a task it doesn't know. Like if I ran
rake foo
It gives the exact thing, but with 'foo' instead of 'README.rdoc'. I get the same results when I run
bundle exec rake doc:app
I'm using rake 10.2.2. Any idea what's going on?
Create a README.rdoc in the project root folder. You might have removed it or replaced it with a README with another filetype extension.
whenever I run a rake task on the command line I get this error message:
'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
at /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
WARNING: Global access to Rake DSL methods is deprecated. Please include
... Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method Billings::Application#task called at /Library/Ruby/Gems/1.8/gems/railties-3.0.1/lib/rails/application.rb:214:in `initialize_tasks'
Loaded suite /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/rake_test_loader
Can anybody tell me how to get rid of this?
How about generating a new app in another directory an copy the Rakefile? If the problem persists, it may be a problem of your custom rake tasks or some of your gems/plugins.
I'm running Ruby 1.9.2 and Rails 3.1 locally and I'm trying to fire up my app. Whenever I use rake (rake spec, rake cucumber, rake db:create) I get these warnings. What did I do wrong?
/Users/me/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/file_utils.rb:10: warning: already initialized constant RUBY
/Users/me/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/file_utils.rb:84: warning: already initialized constant LN_SUPPORTED
Thanks for any pointers in the right direction!
This is caused when you are using Ruby 1.9.2 (that already comes with rake bundled) and you installed the rake gem, for example using bundler.
You can
uninstall the rake gem
$ gem uninstall rake
If you use bundler, keep using bundler. In this case, the right syntax is
$ bundle exec rake spec
not
$ rake spec
The warnings may fade if you prefix your calls to rake with bundle exec, i.e.
bundle exec rake spec
bundle exec rake cucumber
ian.
It seems to me that you've 1 unnecessary require 'rake' in your code
DEPRECATION WARNING: railtie_name is deprecated and has no effect. (called from require at /Users/bm/.rvm/gems/ruby-1.8.7-p302#global/gems/bundler-1.0.3/lib/bundler/runtime.rb:64)
WARNING: Global access to Rake DSL methods is deprecated. Please include
... Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method Hs::Application#task called at /Users/bm/.rvm/gems/ruby-1.8.7-p302#hs/gems/railties-3.0.7/lib/rails/application.rb:215:in `initialize_tasks'
Just created a new rails application (rails 3.0.7).
I see the above message each time I run a rake command.
What is the issue?
You have the newest version of Rake installed, which is not compatible with Rails 3.0.7.
Stick this in your Gemfile:
gem 'rake', '~> 0.8.7'
and run bundle update
After that call your rake tasks prepending: bundle exec
Whilst following these instructions to install wizardly-examples, I get the following error:
[wizardly-examples]$ rake gems:install
(in /Users/jason/Rails/wizardly-examples)
(eval):1: warning: already initialized constant RAILS_ROOT
rake aborted!
wrong number of arguments (1 for 0)
/Users/jason/Rails/wizardly-examples/Rakefile:4:in `<top (required)>'
Can anyone advise how to resolve the issue? Thank you
This could be an out of date gem that's causing trouble. rake gems:install for one never worked properly, and has been eliminated in favor of:
bundle install
Rails 3 has switched to the bundler system by default. Older projects may still have the old task but it shouldn't be used. Since the Rakefile was often dependent on the very gems it was trying to install, you can see how it was a bad idea from the start.
In general if you're having trouble with rake tasks be sure to engage the --trace option to get a better idea of where it's going wrong.