Fernando Perez
2009-Jan-16 19:38 UTC
[rspec-users] App can''t start on production server due to RSpec missing
Hi, I just run in the following problem when starting a Rails app on my production server: You have rspec rake tasks installed in /home/thomas/rails_apps/video_on_demand/lib/tasks/rspec.rake, but rspec can not be found in vendor/gems, vendor/plugins or on the system. Obviously I don''t want Rails to load anything related to rspec, how can I tell Rails that it should not care about RSpec on the production environment? A quick fix is to install rspec and rspec-rails gems on production server, but I don''t get why the app wants them installed. -- Posted via http://www.ruby-forum.com/.
Scott Taylor
2009-Jan-16 20:50 UTC
[rspec-users] App can''t start on production server due to RSpec missing
On Jan 16, 2009, at 2:38 PM, Fernando Perez wrote:> Hi, > > I just run in the following problem when starting a Rails app on my > production server: > > You have rspec rake tasks installed in > /home/thomas/rails_apps/video_on_demand/lib/tasks/rspec.rake, > but rspec can not be found in vendor/gems, vendor/plugins or on the > system. > > > Obviously I don''t want Rails to load anything related to rspec, how > can > I tell Rails that it should not care about RSpec on the production > environment? > > A quick fix is to install rspec and rspec-rails gems on production > server, but I don''t get why the app wants them installed.I would delete that rake task file (lib/rspec.rake) if you don''t have rspec installed. Scott
David Chelimsky
2009-Jan-16 21:05 UTC
[rspec-users] App can''t start on production server due to RSpec missing
On Fri, Jan 16, 2009 at 1:38 PM, Fernando Perez <lists at ruby-forum.com> wrote:> Hi, > > I just run in the following problem when starting a Rails app on my > production server: > > You have rspec rake tasks installed in > /home/thomas/rails_apps/video_on_demand/lib/tasks/rspec.rake, > but rspec can not be found in vendor/gems, vendor/plugins or on the > system. > > > Obviously I don''t want Rails to load anything related to rspec, how can > I tell Rails that it should not care about RSpec on the production > environment? > > A quick fix is to install rspec and rspec-rails gems on production > server, but I don''t get why the app wants them installed.This is a tricky business. We put that in there in response to a user who works on a team. One team member had pulled code and tried t run specs and got an error he didn''t understand, so this is intended to help that developer know he needs to install rspec. So now this creates a new problem for you, which is that this means you have to have rspec installed everywhere you want to run rake tasks. I''m open to suggestions for how to best solve for both cases if you have any. Cheers, David> -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Stephen Eley
2009-Jan-16 21:12 UTC
[rspec-users] App can''t start on production server due to RSpec missing
On Fri, Jan 16, 2009 at 2:38 PM, Fernando Perez <lists at ruby-forum.com> wrote:> > A quick fix is to install rspec and rspec-rails gems on production > server, but I don''t get why the app wants them installed.Because every Rake file in /lib gets loaded when you run Rake. That''s your dependency problem; not the app itself. -- Have Fun, Steve Eley (sfeley at gmail.com) ESCAPE POD - The Science Fiction Podcast Magazine http://www.escapepod.org
Fernando Perez
2009-Jan-16 21:15 UTC
[rspec-users] App can''t start on production server due to RSpec missing
> > I would delete that rake task file (lib/rspec.rake) if you don''t have > rspec installed. > > ScottI run rspec on my dev machine, but obviously not on my production machine, what would be the nicest way to handle such scenario? At the top of rspec.rake I could add a check on the environment, I could also not add this file to my repository but I could forget about this file in future clones of my repo, etc. How did you solve this problem? -- Posted via http://www.ruby-forum.com/.
aslak hellesoy
2009-Jan-16 22:15 UTC
[rspec-users] App can''t start on production server due to RSpec missing
On Fri, Jan 16, 2009 at 10:05 PM, David Chelimsky <dchelimsky at gmail.com>wrote:> On Fri, Jan 16, 2009 at 1:38 PM, Fernando Perez <lists at ruby-forum.com> > wrote: > > Hi, > > > > I just run in the following problem when starting a Rails app on my > > production server: > > > > You have rspec rake tasks installed in > > /home/thomas/rails_apps/video_on_demand/lib/tasks/rspec.rake, > > but rspec can not be found in vendor/gems, vendor/plugins or on the > > system. > > > > > > Obviously I don''t want Rails to load anything related to rspec, how can > > I tell Rails that it should not care about RSpec on the production > > environment? > > > > A quick fix is to install rspec and rspec-rails gems on production > > server, but I don''t get why the app wants them installed. > > This is a tricky business. > > We put that in there in response to a user who works on a team. One > team member had pulled code and tried t run specs and got an error he > didn''t understand, so this is intended to help that developer know he > needs to install rspec. > > So now this creates a new problem for you, which is that this means > you have to have rspec installed everywhere you want to run rake > tasks. > > I''m open to suggestions for how to best solve for both cases if you have > any. >Make it print the message to STDERR instead of raising an error? Plus add a blurb like "You can ignore this warning if you didn''t intend to run specs" Aslak> > Cheers, > David > > > -- > > Posted via http://www.ruby-forum.com/. > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-- Aslak (::) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090116/f744d374/attachment.html>
David Chelimsky
2009-Jan-16 22:58 UTC
[rspec-users] App can''t start on production server due to RSpec missing
On Fri, Jan 16, 2009 at 4:15 PM, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:> > > On Fri, Jan 16, 2009 at 10:05 PM, David Chelimsky <dchelimsky at gmail.com> > wrote: >> >> On Fri, Jan 16, 2009 at 1:38 PM, Fernando Perez <lists at ruby-forum.com> >> wrote: >> > Hi, >> > >> > I just run in the following problem when starting a Rails app on my >> > production server: >> > >> > You have rspec rake tasks installed in >> > /home/thomas/rails_apps/video_on_demand/lib/tasks/rspec.rake, >> > but rspec can not be found in vendor/gems, vendor/plugins or on the >> > system. >> > >> > >> > Obviously I don''t want Rails to load anything related to rspec, how can >> > I tell Rails that it should not care about RSpec on the production >> > environment? >> > >> > A quick fix is to install rspec and rspec-rails gems on production >> > server, but I don''t get why the app wants them installed. >> >> This is a tricky business. >> >> We put that in there in response to a user who works on a team. One >> team member had pulled code and tried t run specs and got an error he >> didn''t understand, so this is intended to help that developer know he >> needs to install rspec. >> >> So now this creates a new problem for you, which is that this means >> you have to have rspec installed everywhere you want to run rake >> tasks. >> >> I''m open to suggestions for how to best solve for both cases if you have >> any. > > Make it print the message to STDERR instead of raising an error? Plus add a > blurb like "You can ignore this warning if you didn''t intend to run specs"Sounds good- any objections?> > Aslak > >> >> Cheers, >> David >> >> > -- >> > Posted via http://www.ruby-forum.com/. >> > _______________________________________________ >> > rspec-users mailing list >> > rspec-users at rubyforge.org >> > http://rubyforge.org/mailman/listinfo/rspec-users >> > >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users > > > > -- > Aslak (::) > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Mark Wilden
2009-Jan-16 23:06 UTC
[rspec-users] App can''t start on production server due to RSpec missing
On Fri, Jan 16, 2009 at 1:15 PM, Fernando Perez <lists at ruby-forum.com>wrote:> > I run rspec on my dev machine, but obviously not on my production > machine, what would be the nicest way to handle such scenario? At the > top of rspec.rake I could add a check on the environmentThat would get my vote. ///ark -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090116/fd7a064a/attachment.html>
Scott Taylor
2009-Jan-16 23:09 UTC
[rspec-users] App can''t start on production server due to RSpec missing
On Jan 16, 2009, at 4:15 PM, Fernando Perez wrote:>> >> I would delete that rake task file (lib/rspec.rake) if you don''t have >> rspec installed. >> >> Scott > > I run rspec on my dev machine, but obviously not on my production > machine, what would be the nicest way to handle such scenario? At the > top of rspec.rake I could add a check on the environment, I could also > not add this file to my repository but I could forget about this > file in > future clones of my repo, etc.I''d most certainly add it to the repos in the form of a plugin. What exactly are you worried about? The memory overhead of loading the rspec code? (I''m not sure exactly how rails works here - does it simply rspec/lib/ to the $LOAD_PATH? Does it require lib/spec.rb?) Obviously if your production code is explicitly calling rspec, you''ve got bigger problems. Scott
David Chelimsky
2009-Jan-16 23:19 UTC
[rspec-users] App can''t start on production server due to RSpec missing
On Fri, Jan 16, 2009 at 5:06 PM, Mark Wilden <mark at mwilden.com> wrote:> On Fri, Jan 16, 2009 at 1:15 PM, Fernando Perez <lists at ruby-forum.com> > wrote: >> >> I run rspec on my dev machine, but obviously not on my production >> machine, what would be the nicest way to handle such scenario? At the >> top of rspec.rake I could add a check on the environment > > That would get my vote.Unless I"m missing something, that would require this on the CLI: RAILS_ENV=test rake spec Therefore, this would not get my vote :)> > ///ark > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Pat Maddox
2009-Jan-17 00:25 UTC
[rspec-users] App can''t start on production server due to RSpec missing
On Fri, Jan 16, 2009 at 2:58 PM, David Chelimsky <dchelimsky at gmail.com> wrote:> On Fri, Jan 16, 2009 at 4:15 PM, aslak hellesoy > <aslak.hellesoy at gmail.com> wrote: >> >> >> On Fri, Jan 16, 2009 at 10:05 PM, David Chelimsky <dchelimsky at gmail.com> >> wrote: >>> >>> On Fri, Jan 16, 2009 at 1:38 PM, Fernando Perez <lists at ruby-forum.com> >>> wrote: >>> > Hi, >>> > >>> > I just run in the following problem when starting a Rails app on my >>> > production server: >>> > >>> > You have rspec rake tasks installed in >>> > /home/thomas/rails_apps/video_on_demand/lib/tasks/rspec.rake, >>> > but rspec can not be found in vendor/gems, vendor/plugins or on the >>> > system. >>> > >>> > >>> > Obviously I don''t want Rails to load anything related to rspec, how can >>> > I tell Rails that it should not care about RSpec on the production >>> > environment? >>> > >>> > A quick fix is to install rspec and rspec-rails gems on production >>> > server, but I don''t get why the app wants them installed. >>> >>> This is a tricky business. >>> >>> We put that in there in response to a user who works on a team. One >>> team member had pulled code and tried t run specs and got an error he >>> didn''t understand, so this is intended to help that developer know he >>> needs to install rspec. >>> >>> So now this creates a new problem for you, which is that this means >>> you have to have rspec installed everywhere you want to run rake >>> tasks. >>> >>> I''m open to suggestions for how to best solve for both cases if you have >>> any. >> >> Make it print the message to STDERR instead of raising an error? Plus add a >> blurb like "You can ignore this warning if you didn''t intend to run specs" > > Sounds good- any objections?That''s what I do in all of my projects...require ''spec'', rescue LoadError and print a helpful message. Pat
Mark Wilden
2009-Jan-17 00:25 UTC
[rspec-users] App can''t start on production server due to RSpec missing
On Fri, Jan 16, 2009 at 3:19 PM, David Chelimsky <dchelimsky at gmail.com>wrote:> >> > >> I run rspec on my dev machine, but obviously not on my production > >> machine, what would be the nicest way to handle such scenario? At the > >> top of rspec.rake I could add a check on the environment > > > > That would get my vote. > > Unless I"m missing something, that would require this on the CLI: > > RAILS_ENV=test rake spec > > Therefore, this would not get my vote :) >Because the rake tasks get loaded before the spec task has a chance to set RAILS_ENV. But the rakefile wouldn''t check RAILS_ENV=test, but RAILS_ENV=production (or staging). And wouldn''t it be set that way before rake loads its files? (I''m gonna learn something here, whether I want to or not!) ///ark -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090116/aa986684/attachment.html>
Andrew Premdas
2009-Jan-17 05:35 UTC
[rspec-users] App can''t start on production server due to RSpec missing
If your using capistrano you could delete this file when deploying. 2009/1/16 Scott Taylor <scott at railsnewbie.com>> > On Jan 16, 2009, at 2:38 PM, Fernando Perez wrote: > > Hi, >> >> I just run in the following problem when starting a Rails app on my >> production server: >> >> You have rspec rake tasks installed in >> /home/thomas/rails_apps/video_on_demand/lib/tasks/rspec.rake, >> but rspec can not be found in vendor/gems, vendor/plugins or on the >> system. >> >> >> Obviously I don''t want Rails to load anything related to rspec, how can >> I tell Rails that it should not care about RSpec on the production >> environment? >> >> A quick fix is to install rspec and rspec-rails gems on production >> server, but I don''t get why the app wants them installed. >> > > I would delete that rake task file (lib/rspec.rake) if you don''t have rspec > installed. > > Scott > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090117/beabf59d/attachment.html>
Fernando Perez
2009-Jan-17 10:22 UTC
[rspec-users] App can''t start on production server due to RSpec missing
> Make it print the message to STDERR instead of raising an error? Plus > add a > blurb like "You can ignore this warning if you didn''t intend to run > specs" > > AslakI like that too, +1 for me.> Obviously if your production code is explicitly calling rspec, you''ve > got bigger problems.As Stephen said, it''s because rspec.rake located under the lib folder is trying to load rspec (gem or plugin) without looking at the rails environment. -- Posted via http://www.ruby-forum.com/.
Jonathan Linowes
2009-Jan-17 13:42 UTC
[rspec-users] App can''t start on production server due to RSpec missing
On Jan 16, 2009, at 4:15 PM, Fernando Perez wrote:> I run rspec on my dev machine, but obviously not on my production > machine, what would be the nicest way to handle such scenario? At theActually, I run specs on my production machine, cap deploy:spec :) since its a different platform from my development, especially on point releases of the app
Mark Wilden
2009-Jan-17 19:14 UTC
[rspec-users] App can''t start on production server due to RSpec missing
On Sat, Jan 17, 2009 at 5:42 AM, Jonathan Linowes <jonathan at parkerhill.com>wrote:> > On Jan 16, 2009, at 4:15 PM, Fernando Perez wrote: > > I run rspec on my dev machine, but obviously not on my production >> machine, what would be the nicest way to handle such scenario? At the >> > > Actually, I run specs on my production machine, > cap deploy:spec > :) > since its a different platform from my development, > especially on point releases of the appUmm, how do you handle that whole rake db:test:prepare thing? ///ark -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090117/39ce5f39/attachment.html>
Jonathan Linowes
2009-Jan-18 14:47 UTC
[rspec-users] App can''t start on production server due to RSpec missing
On Jan 17, 2009, at 2:14 PM, Mark Wilden wrote:> On Sat, Jan 17, 2009 at 5:42 AM, Jonathan Linowes > <jonathan at parkerhill.com> wrote: > > On Jan 16, 2009, at 4:15 PM, Fernando Perez wrote: > > I run rspec on my dev machine, but obviously not on my production > machine, what would be the nicest way to handle such scenario? At the > > Actually, I run specs on my production machine, > cap deploy:spec > :) > since its a different platform from my development, > especially on point releases of the app > > Umm, how do you handle that whole rake db:test:prepare thing? > > ///ark > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-usersI copy the schema from production, the server doesnt have a development database. also, my opts default to --format html so i can browse to the results From my Capfile task :spec, :roles => :app do run "cd #{current_path} && rake db:test:prepare RAILS_ENV=production" # copy schema from production rather than development run "cd #{current_path} && rake spec RAILS_ENV=production >public/private/specs.html" end -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090118/16c1a193/attachment.html>
Scott Taylor
2009-Jan-18 23:24 UTC
[rspec-users] App can''t start on production server due to RSpec missing
Andrew Premdas wrote:> If your using capistrano you could delete this file when deploying.Or just not version control it: git rm -rf --cached lib/tasks/rspec.rake echo "lib/tasks/rspec.rake" >> .gitignore Scott> > 2009/1/16 Scott Taylor <scott at railsnewbie.com > <mailto:scott at railsnewbie.com>> > > > On Jan 16, 2009, at 2:38 PM, Fernando Perez wrote: > > Hi, > > I just run in the following problem when starting a Rails app > on my > production server: > > You have rspec rake tasks installed in > /home/thomas/rails_apps/video_on_demand/lib/tasks/rspec.rake, > but rspec can not be found in vendor/gems, vendor/plugins or > on the > system. > > > Obviously I don''t want Rails to load anything related to > rspec, how can > I tell Rails that it should not care about RSpec on the production > environment? > > A quick fix is to install rspec and rspec-rails gems on production > server, but I don''t get why the app wants them installed. > > > I would delete that rake task file (lib/rspec.rake) if you don''t > have rspec installed. > > Scott > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org <mailto:rspec-users at rubyforge.org> > http://rubyforge.org/mailman/listinfo/rspec-users > > > ------------------------------------------------------------------------ > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
Fernando Perez
2009-Apr-13 16:33 UTC
[rspec-users] App can''t start on production server due to RSpec missing
>> A quick fix is to install rspec and rspec-rails gems on production >> server, but I don''t get why the app wants them installed. > > This is a tricky business. > > We put that in there in response to a user who works on a team. One > team member had pulled code and tried t run specs and got an error he > didn''t understand, so this is intended to help that developer know he > needs to install rspec. > > So now this creates a new problem for you, which is that this means > you have to have rspec installed everywhere you want to run rake > tasks.I haven''t followed the ML latety, but it seems that now I don''t have to install rspec and its friends on the production server anymore. -- Posted via http://www.ruby-forum.com/.