upgraded rails 3 app rake db:reset error - ruby-on-rails

I upgraded my rails 2.3.8 app to rails 3. when I run the rake db:reset command, it returns the following error
rake aborted!
test-unit is not part of the bundle. Add it to Gemfile.
/Users/Shenario/Desktop/stack24/Rakefile:7:in `'
(See full trace by running task with --trace)
i'm new to rails, and wud be glad if you guys out ther coud help me! thanks!
the trace --
rake aborted!
test-unit is not part of the bundle. Add it to Gemfile.
/Users/Shenario/.rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.7/lib/bundler/shared_helpers.rb:102:in block in cripple_rubygems'
/Users/Shenario/Desktop/stack24/lib/tasks/rspec.rake:1:in'
/Users/Shenario/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/engine.rb:131:in load'
/Users/Shenario/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/engine.rb:131:inblock in load_tasks'
/Users/Shenario/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/engine.rb:131:in each'
/Users/Shenario/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/engine.rb:131:inload_tasks'
/Users/Shenario/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/application.rb:141:in load_tasks'
/Users/Shenario/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/application.rb:77:inmethod_missing'
/Users/Shenario/Desktop/stack24/Rakefile:7:in <top (required)>'
/Users/Shenario/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2383:inload'
/Users/Shenario/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2383:in raw_load_rakefile'
/Users/Shenario/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2017:inblock in load_rakefile'
/Users/Shenario/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2068:in standard_exception_handling'
/Users/Shenario/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2016:inload_rakefile'
/Users/Shenario/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2000:in block in run'
/Users/Shenario/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2068:instandard_exception_handling'
/Users/Shenario/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:1998:in run'
/Users/Shenario/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/bin/rake:31:in'
/Users/Shenario/.rvm/gems/ruby-1.9.2-p136/bin/rake:19:in load'
/Users/Shenario/.rvm/gems/ruby-1.9.2-p136/bin/rake:19:in'

After searching for "test-unit", found this:
gem 'test-unit', '2.0.7' if RUBY_VERSION.to_f >= 1.9
in lib/tasks/rspec.rake
I suspected it was caused by me copying the whole lib folder from older rails version to this new one.
Solution: removed that file, then things seem to work fine after.
Basically I suggest you look at lib/tasks and see if there are rake tasks that are incompatible with rails 3.

you must have at least
gem "rails", "~> 3.0.3"
in your Gemfile, then remove Gemfile.lock (if any) and run:
bundle check
if you need some missing gems, run:
bundle install
bundler will install all required gems at least for rails 3.0.3, including test-unit gem. btw remember that a migration from rails 2.3.x to 3.0.x in most cases requires some code changes.

Add this to your Gemfile (replacing VERSION with your required version number).
gem 'test-unit', 'VERSION', :platform => :ruby_19
For Rails 2.3.11, I needed version 1.2.3 of the test-unit gem.

Related

Rails 4.2.9 "cannot load such file" (multiple files)

So it's been a while since I fired up the old Rails server. It took a lot of tricks to even get the bundle to install... but eventually I upgraded from Rails 4.2.6 to 4.2.9. The bundle installs just fine. I'm on Ruby 2.3.0. But now the problem is... whenever I try to run:
rails s
I get the following error:
rails-html-sanitizer.rb:2:in `require': cannot load such file -- loofah (LoadError)
from /home/rainless/.rvm/gems/ruby-2.3.0#rails3.2.16/gems/rails-html-sanitizer-1.0.3/lib/rails-html-sanitizer.rb:2:in `<top (required)>'
from /home/rainless/.rvm/gems/ruby-2.3.0#global/gems/bundler-1.7.9/lib/bundler/runtime.rb:76:in `require'
from /home/rainless/.rvm/gems/ruby-2.3.0#global/gems/bundler-1.7.9/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/rainless/.rvm/gems/ruby-2.3.0#global/gems/bundler-1.7.9/lib/bundler/runtime.rb:72:in `each'
Or some variation of that.
At first I was getting around this by uninstalling whatever the Gem that was said to be unable to load (in this case "loofah" but I've done it with many more), and then adding it to the Gemfile and installing it using Bundler. I now realize that the list is never-ending:
gem 'rails-html-sanitizer'
gem 'chronic'
gem 'multipart-post'
gem 'oauth-active-resource'
gem 'rack-test'
gem 'multi_json'
gem 'addressable'
gem 'orm_adapter'
All the above couldn't load. I ran Rails for years before this... and I know this isn't the way it's supposed to work. Any help/advice on what could be going wrong?
If you see carefully in the error message, it says ruby-2.3.0#rails3.2.16 but you mentioned "upgraded from Rails 4.2.6 to 4.2.9." . For some reason, it's still referring to rails3.2.16. Therefore it could be you need to install the rails-html-sanitizer globally. By the way, Loofah is only needed if you wanted to use it in a non-rails app. Refer to the docs here.
Rails Html Sanitizer is only intended to be used with Rails
applications. If you need similar functionality in non Rails apps
consider using Loofah directly (that's what handles sanitization under
the hood).
from /home/rainless/.rvm/gems/ruby-2.3.0#rails3.2.16/gems/rails-html-sanitizer-1.0.3/lib/rails-html-sanitizer.rb:2:in `<top (required)>'

Spring and middleware conflict?

I'm trying to add oauth2 with Google, following these instructions.
I'm receiving the following error message starting the server:
Exiting
You've tried to invoke Spring when it's already loaded (i.e. the Spring constant is defined).
This is probably because you generated binstubs with Spring 1.0, and you now have a Spring version > 1.0 on your system. To solve this, upgrade your bundle to the latest Spring version and then run `bundle exec spring binstub --all` to regenerate your binstubs. This is a one-time step necessary to upgrade from 1.0 to 1.1.
Here's the backtrace:
/Users/omonia/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:287:in `load'
/Users/omonia/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:287:in `block in load'
/Users/omonia/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:259:in `load_dependency'
/Users/omonia/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:287:in `load'
/Users/omonia/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `<top (required)>'
/Users/omonia/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:133:in `require'
/Users/omonia/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require'
/Users/omonia/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
/Users/omonia/Dropbox/MyApp/bin/spring:13:in `<top (required)>'
The related gems installed:
gem 'google-api-client', '0.9'
gem 'omniauth'
gem 'omniauth-google_oauth2'
The following code is added to config/initializers/omniauth.rb:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :google_oauth2, 'my Google client id', 'my Google client secret', {client_options: {ssl: {ca_file: Rails.root.join("cacert.pem").to_s}}}
end
What is going on here? Following the error instructions doesn't change anything (Spring is of latest version 1.7.2 and running bundle exec spring binstub --all only returns "spring already present").
Putting my comment as answer, because OP confirmed that it did help him. Follow the steps below to install the new Spring and resolve the issue:
run this bin/spring binstub --remove --all
remove the gem from Gemfile and run bundle install.
Now add the gem "spring", group: :development in Gemfile, run bundle install and bundle exec spring binstub --all following doc. Now all should be fine.
I had a similar issue after code upgrade to new rails version, and the following comment helped me resolve it:
https://github.com/rails/spring/issues/610#issuecomment-578188439
Basically, disable spring loader in bin/rails stub, then run rails s until all the code issues are found and fixed, finally, enable spring back.
Check config/initializers/omniauth.rb file and ensure that you have following content:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :google, 'Client_Id', 'Client_Secret'
end
ensure that you exactly have the google provider (not github or facebook)
This is what worked for me -
I ran this on console - rake rails:update:bin
then I ran bundle exec spring binstub --all
I don't guarantee that this would work for all.
Thanks :)
First of all I am not Ruby On Rails Expert, so correct me if I am doing anything wrong with the below steps.
The steps worked for me are below,
from MacOS Terminal run the following..
bin/spring binstub --remove --all
** Remove Your Cache folder under Vender (use Finder)
bundle install.
rails assets:precompile
I had a similar issue and after upgrading my ruby version from 2.6.1 to 2.7.1
and rails 5 to rails 6.
I read the discussion Here
and after disable my loading spring code in bin/rails
#!/usr/bin/env ruby
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'
TO:
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'
i got the error
/home/humayun/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require': cannot load such file -- thwait (LoadError)
and I fix this by adding the following gems to my gem file.
gem 'cmath'
gem 'scanf'
gem 'shell'
gem 'sync'
gem 'thwait'
gem 'e2mmap'
After this, my rails s is working fine and I move bin/rails to its original code.

error while running rake about command

I installed everything of ruby on rails on my linux system..and then when I type the command 'rake about' the following is the error..plz help
rake aborted!
Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
/home/imobigeeks1/work/demo/jbuilder/ruby/1.8/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in `autodetect'
/home/imobigeeks1/work/demo/jbuilder/ruby/1.8/gems/execjs-1.4.0/lib/execjs.rb:5
/home/imobigeeks1/work/demo/jbuilder/ruby/1.8/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
/home/imobigeeks1/work/demo/jbuilder/ruby/1.8/gems/coffee-script-2.2.0/lib/coffee_script.rb:1
/home/imobigeeks1/work/demo/jbuilder/ruby/1.8/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
/home/imobigeeks1/work/demo/jbuilder/ruby/1.8/gems/coffee-script-2.2.0/lib/coffee- script.rb:1
/home/imobigeeks1/work/demo/jbuilder/ruby/1.8/gems/coffee-rails-3.2.2/lib/coffee- rails.rb:1:in `require'
/home/imobigeeks1/work/demo/jbuilder/ruby/1.8/gems/coffee-rails-3.2.2/lib/coffee- rails.rb:1
/home/imobigeeks1/work/demo/config/application.rb:7
/home/imobigeeks1/work/demo/Rakefile:5
(See full trace by running task with --trace)
And I also installed javascript using gem install execjs command still its showing the same problem
put gem 'therubyracer' in your gemfile and then do bundle install from command line.
This gem is for-
Call JavaScript code and manipulate JavaScript objects from Ruby. Call
Ruby code and manipulate Ruby objects from JavaScript.
Source - http://rubydoc.info/gems/therubyracer/0.11.4/frames

Unable to debug in RubyMine 4.5 using Ruby 1.9.3

My apologies for the length of the question, but I want to make it clear I am not making any stupid mistakes!
So, I am struggling to get debugging working in RubyMine 4.5 using Ruby 1.9.3, my steps are as follows:
Fresh (i.e. having removed all previous ruby and gem directories) install of Ruby 1.9.3, Ruby Gems, DevKit and Rails (following this guide) - that works fine.
I then try to begin working with my team's ruby code. I open up the directory in RubyMine (remembering first to delete the .idea directory) and am prompted to run bundle install which I do (from console) as requested. This completes successfully. Restart RubyMine.
I then ensure Ruby is working: Tools > IRB Console > puts "test" #test => nil - Works
I now try the debugger (SHIFT + F9) and see the message:
The gem ruby-debug-base19x required by the debugger is currently not installed. Would you like to install it?"
I click cancel and check my Gemfile, the only ones related to debugging present are:
# Debugging
gem 'debugger'
#gem 'ruby-debug-base19', :require => false
#gem 'ruby-debug19', :require => false
gem 'ruby-prof', :require => false #, :git => 'git://github.com/wycats/ruby-prof.git'
Looks like we have debugger in favour of ruby-debug. Reading here, however, it seems debugger is not sufficient. I need to install ruby-debug-base19x. So, following SO, I comment out debugger from Gemfile and run
gem install ruby-debug-base19x --pre
gem install ruby-debug-ide --pre
Which run fine, so I add
gem 'ruby-debug-base19x', '0.11.30.pre10'
gem 'ruby-debug-ide', '0.4.17.beta14'
to my Gemfile, and run a bundle install from the console.
Finally, i open the debugger inside RubyMine (SHIFT + F9). And puts "test" #test => nil works again. So i try double clicking in the gutter of my script to create a breakpoint, RubyMine pauses for a second and then i get:
D:\Ruby\Ruby193\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) D:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-debug-ide-0.4.17.beta14/bin/rdebug-ide --dispatcher-port 55451 --port 55452 -- S:/code/account_groups/script/rails console
Fast Debugger (ruby-debug-ide 0.4.17.beta14, ruby-debug-base 0.11.30.pre10) listens on 127.0.0.1:55452
D:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/debugger-1.1.4/lib/ruby_debug.so: warning: already initialized constant VERSION
5992: Exception in DebugThread loop: undefined method `errmsg' for #<Debugger::ControlState:0x2a2f3e8>
Backtrace:
D:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/debugger-1.1.4/lib/ruby-debug/command.rb:160:in `errmsg'
from: D:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/debugger-1.1.4/lib/ruby-debug/commands/breakpoints.rb:81:in `execute'
from: D:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-debug-ide-0.4.17.beta14/lib/ruby-debug-ide/ide_processor.rb:89:in `block in process_commands'
from: D:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-debug-ide-0.4.17.beta14/lib/ruby-debug-ide/ide_processor.rb:86:in `catch'
from: D:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-debug-ide-0.4.17.beta14/lib/ruby-debug-ide/ide_processor.rb:86:in `process_commands'
from: D:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-debug-ide-0.4.17.beta14/lib/ruby-debug-ide.rb:160:in `block in start_control'
Process finished with exit code 0
I have also tried using a backup copy of the code and following the same steps, i also get the following error when trying to load up the debugger:
Uncaught exception: cannot load such file -- ruby-debug
D:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
D:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `block in require'
D:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:236:in `load_dependency'
D:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
S:/code/account_groups_so/lib/systematic-online/r_spec_runner.rb:5:in `<top (required)>'
D:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
D:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `block in require'
D:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:236:in `load_dependency'
D:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
S:/code/account_groups_so/config/environment.rb:12:in `block in <top (required)>'
S:/code/account_groups_so/config/environment.rb:12:in `each'
S:/code/account_groups_so/config/environment.rb:12:in `<top (required)>'
D:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
D:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `block in require'
D:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:236:in `load_dependency'
D:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
D:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/application.rb:103:in `require_environment!'
D:/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:40:in `<top (required)>'
S:/code/account_groups_so/script/rails:6:in `require'
S:/code/account_groups_so/script/rails:6:in `<top (required)>'
There is nothing wrong with the script (i have used it fine before) and the trace seems related to ruby-debug-ide - what's going on?
Thanks for any help - this is driving me mad!
UPDATE: RubyMine 6+ supports debugger gem.
Make sure to remove gem 'debugger' from your Gemfile, it's a known conflict that will break debugging from RubyMine. You need only 2 gems related to debugger, exactly as stated in my another answer linked in your question.
After removing the gem you need to ensure it's not referenced anywhere in the project. In this particular case r_spec_runner.rb had require 'ruby-debug' statement causing cannot load such file -- ruby-debug error when trying to run rails console.
To escape this problem I have this line in my Gemfile:
gem 'debugger' unless ENV["RM_INFO"]
Just to document the solution from jetbrains:
Use either:
gem 'debugger', {group: [:test, :development]}.merge(ENV['RM_INFO'] ? {require: false} : {})
Or:
gem 'pry-debug', {group: [:test, :development]}.merge(ENV['RM_INFO'] ? {require: false} : {})
This makes sure that the Gemfile.lock remains unchanged, so a group with mixed RubyMine and vi/sublime/whatever can work happily, by do not requiring the gem in a RubyMine environment.
I had the same issue, and it cost me hours to get it working. Here is what finally got the debugger going (this is using RVM):
Quit RubyMine
If Ruby 1.9.3 is installed, uninstall it: rvm remove 1.9.3
Install Ruby 1.9.3 under RVM: rvm install 1.9.3 --with-gcc=clang - this produces the error "unsupported option '--with-libyaml'", but I haven't seen any ill effects from this yet
Switch to the new ruby: rvm use 1.9.3
List and remove all ruby-debug* gems: gem list | grep debug - gem uninstall <found gems>
Download linecache19 from http://rubyforge.org/frs/?group_id=8883 and install the gem, i.e.: gem install linecache19-0.5.13.gem
Lauch RubyMine, and run the debugger; it will inform about missing debug gems (i.e. ruby-debug-ide); let RubyMine install those.
That's when the debugger started working. See also this RubyMine support discussion: http://devnet.jetbrains.com/message/5443846#5443846
Finally got this working today with a huge kludge hack. I think the step that did it was
sudo chmod -R 777 ~/.rvm
Let RubyMine do its thing
I also made sure to uninstall every gem I had besides rake. I think reby-debug-ide, ruby-debug-base19x, linecache19, ruby_core_source, archive-tar-minitar, and columnize are the important ones. I also uninstalled rvm and reinstalled with clang. But I'd try just doing the chmod thing first. I tried changing to 766, but RubyMine didn't like it. So huge kludge hack it is. I now get lots of warnings about Insecure world but at least the debugger is working. Pretty sure the next version of RubyMine will not use the old ruby-debug-base19x, but instead the more recently edited gems at https://github.com/ruby-debug. So hopefully someone at the awesome JetBrains will fix it. Btw also tried running RubyMine with sudo mine but that didn't do the trick either.
I had some problems with the debugger.
I installed Rails and set the path in configuration options to the ruby.exe in the rails installation and everything is working perfect.

"uninitialized constant" when running RSpec tests with Rails 2.3.8 and Bundler

I just changed my Rails 2.3.8 project to load gems using Bundler, rather than the default Rails 2.3 loading mechanism. I followed the official instructions and the site runs fine in development. I use RVM for gem management, and have a specific gemset loaded for the application.
My RSpec test suite is unable to run, however. I have tried running both the entire suite and single tests using a variety of commands:
autospec # My usual way of running tests
rake spec
spec .
spec spec/models/comment_spec.rb # Trying a single spec file in isolation
ruby spec/models/comment_spec.rb
I have also tried running them all prefixed with bundle exec. Everything returns the same error:
/Users/casper/.rvm/gems/ruby-1.8.7-p248#darebusters/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant InheritedResources::Base (NameError)
from /Users/casper/.rvm/gems/ruby-1.8.7-p248#darebusters/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:80:in `const_missing_not_from_s3_library'
from /Users/casper/.rvm/gems/ruby-1.8.7-p248#darebusters/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in `const_missing'
from /Users/casper/Projects/cf/darebusters/app/controllers/admin/base_controller.rb:1
from /Users/casper/.rvm/gems/ruby-1.8.7-p248#darebusters/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:158:in `require'
from /Users/casper/.rvm/gems/ruby-1.8.7-p248#darebusters/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:158:in `require'
from /Users/casper/.rvm/gems/ruby-1.8.7-p248#darebusters/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:265:in `require_or_load'
from /Users/casper/.rvm/gems/ruby-1.8.7-p248#darebusters/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:224:in `depend_on'
from /Users/casper/.rvm/gems/ruby-1.8.7-p248#darebusters/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:136:in `require_dependency'
from /Users/casper/.rvm/gems/ruby-1.8.7-p248#darebusters/gems/rails-2.3.8/lib/initializer.rb:414:in `load_application_classes'
from /Users/casper/.rvm/gems/ruby-1.8.7-p248#darebusters/gems/rails-2.3.8/lib/initializer.rb:413:in `each'
from /Users/casper/.rvm/gems/ruby-1.8.7-p248#darebusters/gems/rails-2.3.8/lib/initializer.rb:413:in `load_application_classes'
from /Users/casper/.rvm/gems/ruby-1.8.7-p248#darebusters/gems/rails-2.3.8/lib/initializer.rb:411:in `each'
from /Users/casper/.rvm/gems/ruby-1.8.7-p248#darebusters/gems/rails-2.3.8/lib/initializer.rb:411:in `load_application_classes'
from /Users/casper/.rvm/gems/ruby-1.8.7-p248#darebusters/gems/rails-2.3.8/lib/initializer.rb:197:in `process'
from /Users/casper/.rvm/gems/ruby-1.8.7-p248#darebusters/gems/rails-2.3.8/lib/initializer.rb:113:in `send'
from /Users/casper/.rvm/gems/ruby-1.8.7-p248#darebusters/gems/rails-2.3.8/lib/initializer.rb:113:in `run'
from /Users/casper/Projects/cf/darebusters/config/environment.rb:9
from /Users/casper/Projects/cf/darebusters/spec/spec_helper.rb:5:in `require'
from /Users/casper/Projects/cf/darebusters/spec/spec_helper.rb:5
from spec/models/comment_spec.rb:1:in `require'
from spec/models/comment_spec.rb:1
I'm pretty sure the problem is not related to the Inherited Resources gem - I think gems are not loaded at all at this point, and Inherited Resources just happens to be the first one needed.
The thing that's baffling me is that /activesupport-2.3.8/lib/active_support/dependencies.rb:158 requires /app/controllers/admin/base_controller during the initialization phase. It shouldn't do that, and it certaintly doesn't do it in development mode. I can comment out gem 'inherited_resources' in my Gemfile, and site still runs. It's not until I hit an action that loads a controller that use Inherited Resources I get the "uninitialized constant" error.
For clarity, here's my Gemfile and spec_helper.rb.
Even older question, but I had the same issue with Bundler 1.0.3, Rspec-Rails 1.3.3 & Rails 2.3.8 and was able to boil it down to remarkable_rails. Remarkable-Rails seems to load rspec/rails before the initializers are run by the environment.
After adding :require => nil to it in the Gemfile and requiring it by hand in spec_helper AFTER requiring the rails-environment the issue disappeared.
I realize this is an old question, but I just came across the same problem.
I had the 1.3.0 version of rspec and rspec-rails required by my application. Looking at the rspec-rails changelog, I noticed there were a few bug fixes after 1.3.0. Upgrading rspec-rails to 1.3.2 fixed everything for me.
To fix this problem I changed by Gemfile from:
gem 'rspec-rails', '~> 1.3.2', :require => 'spec/rails'
to
gem 'rspec-rails', '~> 1.3.2'
and added the following to my spec helper
require 'spec/rails'

Resources