Trying to run rspec, but it couldn't read the tests file - ruby-on-rails

require 'rails_helper'
RSpec.describe User, type: :model do
before { #user = FactoryGirl.build(:user) }
it { expect(#user).to respond_to(:email) }
end
The error:
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:30: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
WARN: Unresolved or ambiguous specs during Gem::Specification.reset:
diff-lcs (< 2.0, >= 1.2.0)
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
Available/installed versions of this gem:
- 1.5.0
- 1.3
WARN: Clearing out unresolved specs. Try 'gem cleanup <gem>'
Please report a bug if this causes problems.
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/var/lib/gems/2.3.0/gems/rspec-core-3.9.3/lib/rspec/core/formatters.rb:212:in `require': cannot load such file -- rspec/core/formatters/progress_formatter (LoadError)
from /var/lib/gems/2.3.0/gems/rspec-core-3.9.3/lib/rspec/core/formatters.rb:212:in `built_in_formatter'
from /var/lib/gems/2.3.0/gems/rspec-core-3.9.3/lib/rspec/core/formatters.rb:182:in `find_formatter'
from /var/lib/gems/2.3.0/gems/rspec-core-3.9.3/lib/rspec/core/formatters.rb:152:in `add'
from /var/lib/gems/2.3.0/gems/rspec-core-3.9.3/lib/rspec/core/formatters.rb:127:in `setup_default'
from /var/lib/gems/2.3.0/gems/rspec-core-3.9.3/lib/rspec/core/reporter.rb:47:in `block in prepare_default'
from /var/lib/gems/2.3.0/gems/rspec-core-3.9.3/lib/rspec/core/reporter.rb:236:in `ensure_listeners_ready'
from /var/lib/gems/2.3.0/gems/rspec-core-3.9.3/lib/rspec/core/reporter.rb:207:in `notify'
from /var/lib/gems/2.3.0/gems/rspec-core-3.9.3/lib/rspec/core/reporter.rb:100:in `message'
from /var/lib/gems/2.3.0/gems/rspec-core-3.9.3/lib/rspec/core/world.rb:196:in `report_filter_message'
from /var/lib/gems/2.3.0/gems/rspec-core-3.9.3/lib/rspec/core/world.rb:188:in `announce_filters'
from /var/lib/gems/2.3.0/gems/rspec-core-3.9.3/lib/rspec/core/runner.rb:104:in `ensure in setup'
from /var/lib/gems/2.3.0/gems/rspec-core-3.9.3/lib/rspec/core/runner.rb:104:in `setup'
from /var/lib/gems/2.3.0/gems/rspec-core-3.9.3/lib/rspec/core/runner.rb:86:in `run'
from /var/lib/gems/2.3.0/gems/rspec-core-3.9.3/lib/rspec/core/runner.rb:71:in `run'
from /var/lib/gems/2.3.0/gems/rspec-core-3.9.3/lib/rspec/core/runner.rb:45:in `invoke'
from /var/lib/gems/2.3.0/gems/rspec-core-3.9.3/exe/rspec:4:in `<top (required)>'
from /usr/local/bin/rspec:23:in `load'
from /usr/local/bin/rspec:23:in `<main>'

First, we need to remove the unnecessary gem. Try running bundle clean --force.
This command will remove all unused gems in your bundler directory. This is useful when you have made many changes to your gem dependencies.
You can check more information about that comment in this link.
Now runs
bundle install
and try to rerun your tests. It seems that those two steps have helped other people:
https://github.com/rubygems/rubygems/issues/1945#issuecomment-334979982

Related

rake aborted; SystemStackError, NoMethodError while running bundle exec rake db:migrate

I am working on an existing project, which was made around 2014. While running bundle exec rake db:migrate I get the following error:
bundle exec rake db:migrate
D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-4.0.0/lib/active_support/core_ext/object/duplicable.rb:82: warning: BigDecimal.new is deprecated; use BigDecimal() method instead.
D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-4.0.0/lib/active_support/values/time_zone.rb:282: warning: circular argument reference - now
D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-4.0.0/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Fixnum is deprecated
D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-4.0.0/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Bignum is deprecated
rake aborted!
SystemStackError: stack level too deep
rake aborted!
NoMethodError: undefined method `reject' for nil:NilClass
Traceback (most recent call last):
D:/Ruby/Ruby26-x64/bin/rake: stack level too deep (SystemStackError)
D:/Ruby/Ruby26-x64/bin/rake: undefined method `reject' for nil:NilClass (NoMethodError)
9: from D:/Ruby/Ruby26-x64/bin/rake:23:in `<main>'
8: from D:/Ruby/Ruby26-x64/bin/rake:23:in `load'
7: from D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
6: from D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:80:in `run'
5: from D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:185:in `standard_exception_handling'
4: from D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:195:in `rescue in standard_exception_handling'
3: from D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:208:in `display_error_message'
2: from D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:218:in `display_exception_details'
1: from D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:249:in `display_exception_backtrace'
D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/backtrace.rb:21:in `collapse': undefined method `reject' for nil:NilClass (NoMethodError)
My Ruby version is 2.6.6p146, and Rails 4.0.0 (as required by the gemfile)
I've also read similar issues and tried gem update --system, but the same problem persists.
I can't really speak to that Rails 4 won't run on Ruby 2.6. But there's always a possibility that you hit subtle issues, depending on the features you use and the gems that you include. From Ruby 2.4, it has the Fixnum and Bignum unification, as well as unicode changes - which potentially could have an impact.
I suggest you to upgrade Rails version to 6 or downgrade Ruby version to 2.2.

How to run rspec without deprecated warnings

I was trying to follow "Getting Started with RSpec — Part 1", however, whenever I try to run
rspec
I receive:
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:30: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /usr/share/rubygems-integration/2.5.0/specifications/raspell-1.3.gemspec:20.
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
An error occurred while loading spec_helper.
Failure/Error: return gem_original_require(path)
LoadError:
cannot load such file -- spec_helper
# /usr/local/lib/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:92:in `require'
# /usr/local/lib/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:92:in `require'
# /var/lib/gems/2.5.0/gems/rspec-core-3.9.2/lib/rspec/core/configuration.rb:2103:in `load_file_handling_errors'
# /var/lib/gems/2.5.0/gems/rspec-core-3.9.2/lib/rspec/core/configuration.rb:1565:in `block in requires='
# /var/lib/gems/2.5.0/gems/rspec-core-3.9.2/lib/rspec/core/configuration.rb:1565:in `each'
# /var/lib/gems/2.5.0/gems/rspec-core-3.9.2/lib/rspec/core/configuration.rb:1565:in `requires='
# /var/lib/gems/2.5.0/gems/rspec-core-3.9.2/lib/rspec/core/configuration_options.rb:113:in `block in process_options_into'
# /var/lib/gems/2.5.0/gems/rspec-core-3.9.2/lib/rspec/core/configuration_options.rb:112:in `each'
# /var/lib/gems/2.5.0/gems/rspec-core-3.9.2/lib/rspec/core/configuration_options.rb:112:in `process_options_into'
# /var/lib/gems/2.5.0/gems/rspec-core-3.9.2/lib/rspec/core/configuration_options.rb:22:in `configure'
# /var/lib/gems/2.5.0/gems/rspec-core-3.9.2/lib/rspec/core/runner.rb:132:in `configure'
# /var/lib/gems/2.5.0/gems/rspec-core-3.9.2/lib/rspec/core/runner.rb:99:in `setup'
# /var/lib/gems/2.5.0/gems/rspec-core-3.9.2/lib/rspec/core/runner.rb:86:in `run'
# /var/lib/gems/2.5.0/gems/rspec-core-3.9.2/lib/rspec/core/runner.rb:71:in `run'
# /var/lib/gems/2.5.0/gems/rspec-core-3.9.2/lib/rspec/core/runner.rb:45:in `invoke'
# /var/lib/gems/2.5.0/gems/rspec-core-3.9.2/exe/rspec:4:in `<top (required)>'
# /usr/local/bin/rspec:23:in `load'
# /usr/local/bin/rspec:23:in `<main>'
#
# Showing full backtrace because every line was filtered out.
# See docs for RSpec::Configuration#backtrace_exclusion_patterns and
# RSpec::Configuration#backtrace_inclusion_patterns for more information.
No examples found.
Finished in 0.00004 seconds (files took 0.06007 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples
I am new to Rspec. I checked ruby -v:
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
However, gem -v results in:
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:30: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /usr/share/rubygems-integration/all/specifications/dnsruby-1.54.gemspec:17.
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /usr/share/rubygems-integration/all/specifications/erubis-2.7.0.gemspec:17.
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /usr/share/rubygems-integration/all/specifications/image_science-1.2.2.gemspec:20.
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /usr/share/rubygems-integration/all/specifications/net-http-persistent-2.9.4.gemspec:20.
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /usr/share/rubygems-integration/2.5.0/specifications/raspell-1.3.gemspec:20.
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /usr/share/rubygems-integration/all/specifications/snmp-1.2.0.gemspec:18.
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:30: warning: constant Gem::ConfigMap is deprecated
3.1.3
I tried to install Nokogiri and to fix the Gem::ConfigMap deprecated issue but nothing seemed to work.
How should I run the tests?
For some time now I have had problems loading my "calculator_spec.rb" test with or without "spec_helper", this tutorial that you showed "Introduction to RSpec - Part 1" is very easy. This problem is not in the spec_helper, if you follow the steps, but in how you are writing in your text editor. I use the sublime, try not to give Ctrl + C - V, type the code because quotes, spaces can be interpreted differently afterwards in the interpreter.
As for the deprecated gem, you are using rspec version 3.1, your post is not as old as the current version 3.9, do not specify the version in Gemfile as it will automatically install the latest version.
Recommendations:
Use a newer version of ruby.
Preferably using an RVM.
Follow the tutorial presented, without copying and pasting, for now do nothing beyond the scope. (There is no installation of spec_helper).

rake db:migrate error when i'm trying install ratyrate

I tried to install ratyrate. I added it to my Gemfile and ran bundle install
Now, after running rake db:migrate, I got this:
/var/lib/gems/2.3.0/gems/mime-types-1.25.1/lib/mime/types.rb:36: warning: already initialized constant MIME::Type::VERSION
/usr/lib/ruby/vendor_ruby/mime/type.rb:56: warning: previous definition of VERSION was here
/var/lib/gems/2.3.0/gems/mime-types-1.25.1/lib/mime/types.rb:40: warning: already initialized constant MIME::Type::MEDIA_TYPE_RE
/usr/lib/ruby/vendor_ruby/mime/type.rb:61: warning: previous definition of MEDIA_TYPE_RE was here
/var/lib/gems/2.3.0/gems/mime-types-1.25.1/lib/mime/types.rb:43: warning: already initialized constant MIME::Type::PLATFORM_RE
/usr/lib/ruby/vendor_ruby/mime/type.rb:64: warning: previous definition of PLATFORM_RE was here
/var/lib/gems/2.3.0/gems/mime-types-1.25.1/lib/mime/types.rb:50: warning: already initialized constant MIME::Type::IANA_URL
/usr/lib/ruby/vendor_ruby/mime/type.rb:71: warning: previous definition of IANA_URL was here
/var/lib/gems/2.3.0/gems/mime-types-1.25.1/lib/mime/types.rb:51: warning: already initialized constant MIME::Type::RFC_URL
/usr/lib/ruby/vendor_ruby/mime/type.rb:72: warning: previous definition of RFC_URL was here
/var/lib/gems/2.3.0/gems/mime-types-1.25.1/lib/mime/types.rb:52: warning: already initialized constant MIME::Type::DRAFT_URL
/usr/lib/ruby/vendor_ruby/mime/type.rb:73: warning: previous definition of DRAFT_URL was here
/var/lib/gems/2.3.0/gems/mime-types-1.25.1/lib/mime/types.rb:54: warning: already initialized constant MIME::Type::CONTACT_URL
/usr/lib/ruby/vendor_ruby/mime/type.rb:74: warning: previous definition of CONTACT_URL was here
rake aborted!
Bundler::GemRequireError: There was an error while trying to load the gem 'paperclip'.
/home/ilyakogan/project1/config/application.rb:7:in `<top (required)>'
/home/ilyakogan/project1/Rakefile:4:in `require_relative'
/home/ilyakogan/project1/Rakefile:4:in `<top (required)>'
/var/lib/gems/2.3.0/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
Caused by:
NameError: private constant MIME::Type::MEDIA_TYPE_RE referenced
/var/lib/gems/2.3.0/gems/mime-types-1.25.1/lib/mime/types.rb:738:in `singleton class'
/var/lib/gems/2.3.0/gems/mime-types-1.25.1/lib/mime/types.rb:721:in `<class:Types>'
/var/lib/gems/2.3.0/gems/mime-types-1.25.1/lib/mime/types.rb:562:in `<module:MIME>'
/var/lib/gems/2.3.0/gems/mime-types-1.25.1/lib/mime/types.rb:4:in `<top (required)>'
/var/lib/gems/2.3.0/gems/paperclip-5.2.1/lib/paperclip.rb:62:in `require'
/var/lib/gems/2.3.0/gems/paperclip-5.2.1/lib/paperclip.rb:62:in `<top (required)>'
/home/ilyakogan/project1/config/application.rb:7:in `<top (required)>'
/home/ilyakogan/project1/Rakefile:4:in `require_relative'
/home/ilyakogan/project1/Rakefile:4:in `<top (required)>'
/var/lib/gems/2.3.0/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
(See full trace by running task with --trace)
the mime-type gem seems to be available in 2 different directories:
/var/lib/gems/2.3.0/gems/mime-types-1.25.1/lib/mime/types.rb:40: warning: already initialized constant MIME::Type::MEDIA_TYPE_RE
/usr/lib/ruby/vendor_ruby/mime/type.rb:61: warning: previous definition of MEDIA_TYPE_RE was here
So, you have to uninstall the gem under /usr/lib/ruby/vendor_ruby/.

ROR Webrick Server startup errors

When I try to start up the MacPorts installed Ruby on Rail Webrick Server to get back into my RoR training after putting it down for like a year I got the following errors on executing ruby -d script/server:
Exception `LoadError' at /opt/local/lib/ruby/site_ruby/1.8/rubygems.rb:1215 - no such file to load -- rubygems/defaults/operating_system
Exception `NoMethodError' at /opt/local/lib/ruby/1.8/rational.rb:78 - undefined method `gcd' for Rational(1, 2):Rational
Exception `Gem::LoadError' at /opt/local/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:247 - Could not find memcache-client (>= 1.7.4) amongst [abstract-1.0.0, actionmailer-3.0.3, actionmailer-2.3.8, actionpack-3.0.3, actionpack-2.3.8, activemodel-3.0.3, activerecord-3.0.3, activerecord-2.3.8, activeresource-3.0.3, activeresource-2.3.8, activesupport-3.0.3, activesupport-2.3.8, arel-2.0.6, builder-2.1.2, bundler-1.0.7, cgi_multipart_eof_fix-2.5.0, daemon_controller-0.2.6, daemons-1.1.0, erubis-2.6.6, fastthread-1.0.7, gem_plugin-0.2.3, i18n-0.5.0, mail-2.2.12, mime-types-1.16, mongrel-1.1.5, mysql-2.8.1, mysql2-0.2.10, passenger-3.0.7, polyglot-0.3.1, rack-1.2.1, rack-1.1.0, rack-mount-0.6.13, rack-test-0.5.6, rails-3.0.3, rails-2.3.8, railties-3.0.3, rake-0.8.7, rubygems-update-1.8.5, sqlite3-ruby-1.3.2, thor-0.14.6, treetop-1.4.9, typhoeus-0.3.3, tzinfo-0.3.23, xml-simple-1.1.1]
/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/vendor.rb:32: warning: redefine normalize_translation_keys
Exception `TypeError' at (eval):4 - can't modify frozen object
Exception `MissingSourceFile' at /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36 - no such file to load -- fast_xs
Exception `MissingSourceFile' at /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:62 - no such file to load -- fast_xs
Exception `NameError' at /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:55 - uninitialized constant ActiveSupport::Dependencies::Mutex
/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:55: uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support.rb:57
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /opt/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/commands/server.rb:1
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
Are these errors caused because the Rails project I made before was made with an older Gems or Ruby version (Been updated every time I updated my MacPorts)? How can I remedy this?
Update
Found Uninitialized constant ActiveSupport::Dependencies::Mutex (NameError) which is similar. Now updating gems and retrying all again soon.
Update 2
Updated all gems Just got one error:
Updating mysql2
ERROR: While executing gem ... (Gem::GemNotFoundException)
Could not find a valid gem 'mysql2' (0.3.11) locally or in a repository
Error:
ruby script/server
/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:55: uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support.rb:57
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /opt/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/commands/server.rb:1
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from script/server:3
still persists, but may need some kind of restart
Update 3
I added require 'thread' to to the top of config/boot.rb as suggested in the answer of #thekingoftruth at the earlier mentioned thread. Now Webrick starts. I do get a lot of errors still saying:
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /opt/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#refresh! is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#refresh! called from /opt/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails/vendor_gem_source_index.rb:34.
NOTE: Gem::SourceIndex#load_gems_in is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#load_gems_in called from /opt/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:320.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /opt/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127.
As shown in updates I resolved the issue myself. And I am using RVM now on my OSX Lion.

Rake doc:rails errors

Trying to generate Rails API documentation, but running into errors:
$ rake doc:rails
rake aborted!
undefined method `task' for #<DummyApp::Application:0x00000100dd14d0>
(See full trace by running task with --trace)
MacBook-Pro-van-Joris-Ooms:dummy_app joris$ rake doc:rails --trace
rake aborted!
undefined method `task' for #<DummyApp::Application:0x000001023b1ea8>
/Users/joris/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/application.rb:215:in `initialize_tasks'
/Users/joris/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/application.rb:139:in `load_tasks'
/Users/joris/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing'
/Users/joris/Desktop/Projects/Rails/dummy_app/Rakefile:7:in `<top (required)>'
/Users/joris/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load'
/Users/joris/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/Users/joris/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.0/lib/rake/application.rb:495:in `raw_load_rakefile'
/Users/joris/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.0/lib/rake/application.rb:78:in `block in load_rakefile'
/Users/joris/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/joris/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.0/lib/rake/application.rb:77:in `load_rakefile'
/Users/joris/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.0/lib/rake/application.rb:61:in `block in run'
/Users/joris/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/joris/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.0/lib/rake/application.rb:59:in `run'
/Users/joris/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.0/bin/rake:31:in `<top (required)>'
/Users/joris/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `load'
/Users/joris/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `<main>'
Had something similar earlier, where I had to downgrade my Rake (0.9) back to 0.8.7. I upgraded my gems since though; should I just downgrade again or is there a way to fix this and keep using Rake 0.9?
UPDATE:
After downgrading to Rake 0.8.7:
s$ rake doc:rails
(in /Users/joris/Desktop/Projects/Rails/dummy)
/Users/joris/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.8.7/lib/rake.rb:32: warning: already initialized constant RAKEVERSION
/Users/joris/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.8.7/lib/rake/alt_system.rb:32: warning: already initialized constant WINDOWS
WARNING: Possible conflict with Rake extension: String#ext already exists
WARNING: Possible conflict with Rake extension: String#pathmap already exists
/Users/joris/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.8.7/lib/rake.rb:404: warning: already initialized constant EMPTY_TASK_ARGS
/Users/joris/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.8.7/lib/rake.rb:452: warning: already initialized constant EMPTY
/Users/joris/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.8.7/lib/rake.rb:960: warning: already initialized constant RUBY_EXT
/Users/joris/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.8.7/lib/rake.rb:964: warning: already initialized constant RUBY
/Users/joris/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.8.7/lib/rake.rb:1033: warning: already initialized constant LN_SUPPORTED
/Users/joris/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.8.7/lib/rake.rb:1242: warning: already initialized constant ARRAY_METHODS
/Users/joris/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.8.7/lib/rake.rb:1245: warning: already initialized constant MUST_DEFINE
/Users/joris/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.8.7/lib/rake.rb:1249: warning: already initialized constant MUST_NOT_DEFINE
/Users/joris/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.8.7/lib/rake.rb:1253: warning: already initialized constant SPECIAL_RETURN
/Users/joris/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.8.7/lib/rake.rb:1259: warning: already initialized constant DELEGATING_METHODS
/Users/joris/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.8.7/lib/rake.rb:1569: warning: already initialized constant DEFAULT_IGNORE_PATTERNS
/Users/joris/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.8.7/lib/rake.rb:1575: warning: already initialized constant DEFAULT_IGNORE_PROCS
/Users/joris/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.8.7/lib/rake.rb:1612: warning: already initialized constant FileList
/Users/joris/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.8.7/lib/rake.rb:1638: warning: already initialized constant EARLY
/Users/joris/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.8.7/lib/rake.rb:1968: warning: already initialized constant DEFAULT_RAKEFILES
rake aborted!
stack level too deep
Using #Zabba's approach:
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
after editing the Rakefile.
Thanks in advance!
Rake 0.9.0 has this problem.
To fix it, either downgrade to rake 0.8.7 or continue to use rake 0.9.0 and add the following just before the My_app_name::Application.load_tasks in Rakefile in the root of your app's directory:
#in case there is an error "undefined method `task'", add this (rake 0.9.0 has this bug)
module ::My_app_name
class Application
include Rake::DSL
end
end
module ::RakeFileUtils
extend Rake::FileUtilsExt
end
#code added above this line
My_app_name::Application.load_tasks
Put this in your Gemfile and then use bundle exec rake instead:
gem 'rake', '0.8.7'

Resources