nathanvda
2010-Sep-13 07:49 UTC
[rspec-users] rails3: in production i get uninitialised constant rspec?
I am trying to deploy my rails3 application in a production environment. But when i run my first rake task: RAILS_ENV=production rake db:setup i always get the following result: rake aborted! uninitialized constant RSpec and then points to the line in the Rakefile where it says MyApp::Application.load_tasks I do not have any lib/tasks referring to rspec; my gemfile does not refer to any rspec or test gem in production. Has anybody else encountered this? (i have upgraded to beta.22, but encountered it with beta.20 first)
nathanvda
2010-Sep-13 07:58 UTC
[rspec-users] rails3: in production i get uninitialised constant rspec?
Whoops. Found it! I have a rcov.rake inside my lib/tasks like this: desc "Run all specs with rcov" RSpec::Core::RakeTask.new("test_cov") do |t| t.rcov = true t.rcov_opts = %w{--rails --include views --exclude gems\/,spec \/,features\/,seeds\/} end Now i am looking for a clean way to disable this task in production environment. Any hints? On Sep 13, 9:49?am, nathanvda <nathan... at gmail.com> wrote:> I am trying to deploy my rails3 application in a production > environment. But when i run my first rake task: > > ? ? RAILS_ENV=production rake db:setup > > i always get the following result: > > ? ? rake aborted! > ? ? uninitialized constant RSpec > > and then points to the line in the Rakefile where it says > > ? ? MyApp::Application.load_tasks > > I do not have any lib/tasks referring to rspec; my gemfile does not > refer to any rspec or test gem in production. > Has anybody else encountered this? > > (i have upgraded to beta.22, but encountered it with beta.20 first) > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
Justin Ko
2010-Sep-13 08:01 UTC
[rspec-users] rails3: in production i get uninitialised constant rspec?
On Sep 13, 3:58?am, nathanvda <nathan... at gmail.com> wrote:> Whoops. Found it! I have a rcov.rake inside my lib/tasks like this: > > desc ?"Run all specs with rcov" > RSpec::Core::RakeTask.new("test_cov") do |t| > ? t.rcov = true > ? t.rcov_opts = %w{--rails --include views --exclude gems\/,spec > \/,features\/,seeds\/} > end > > Now i am looking for a clean way to disable this task in production > environment. > Any hints? > > On Sep 13, 9:49?am, nathanvda <nathan... at gmail.com> wrote: > > > > > I am trying to deploy my rails3 application in a production > > environment. But when i run my first rake task: > > > ? ? RAILS_ENV=production rake db:setup > > > i always get the following result: > > > ? ? rake aborted! > > ? ? uninitialized constant RSpec > > > and then points to the line in the Rakefile where it says > > > ? ? MyApp::Application.load_tasks > > > I do not have any lib/tasks referring to rspec; my gemfile does not > > refer to any rspec or test gem in production. > > Has anybody else encountered this? > > > (i have upgraded to beta.22, but encountered it with beta.20 first) > > _______________________________________________ > > rspec-users mailing list > > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-usersunless Rails.env.production? # non-production code end
Myron Marston
2010-Sep-13 14:51 UTC
[rspec-users] rails3: in production i get uninitialised constant rspec?
On Sep 13, 1:01?am, Justin Ko <jko... at gmail.com> wrote:> On Sep 13, 3:58?am, nathanvda <nathan... at gmail.com> wrote: > > > > > > > Whoops. Found it! I have a rcov.rake inside my lib/tasks like this: > > > desc ?"Run all specs with rcov" > > RSpec::Core::RakeTask.new("test_cov") do |t| > > ? t.rcov = true > > ? t.rcov_opts = %w{--rails --include views --exclude gems\/,spec > > \/,features\/,seeds\/} > > end > > > Now i am looking for a clean way to disable this task in production > > environment. > > Any hints? > > > On Sep 13, 9:49?am, nathanvda <nathan... at gmail.com> wrote: > > > > I am trying to deploy my rails3 application in a production > > > environment. But when i run my first rake task: > > > > ? ? RAILS_ENV=production rake db:setup > > > > i always get the following result: > > > > ? ? rake aborted! > > > ? ? uninitialized constant RSpec > > > > and then points to the line in the Rakefile where it says > > > > ? ? MyApp::Application.load_tasks > > > > I do not have any lib/tasks referring to rspec; my gemfile does not > > > refer to any rspec or test gem in production. > > > Has anybody else encountered this? > > > > (i have upgraded to beta.22, but encountered it with beta.20 first) > > > _______________________________________________ > > > rspec-users mailing list > > > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > > rspec-users mailing list > > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > > unless Rails.env.production? > ? # non-production code > end > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-usersif defined?(RSpec) desc "Run all specs with rcov" RSpec::Core::RakeTask.new("test_cov") do |t| t.rcov = true t.rcov_opts = %w{--rails --include views --exclude gems\/,spec \/,features\/,seeds\/} end end