I''m trying to get rspec-puppet working and have run into a problem. I have a VM running ubuntu lucid, have installed rubygems 1.3.5 from the apt package and have install rspec-puppet (and other required gems), and rake, using gem install. I''ve run rspec-puppet-init in the module I want to test, and have created a very basic spec file for one of the classes in my module. However, when I run ''rake spec'' from the top level of the module directory, I get the following error: *(in /modules/couchbase)* */usr/bin/ruby1.8 -S rspec spec/classes/init_spec.rb* */usr/bin/ruby1.8: No such file or directory -- rspec (LoadError)* */usr/bin/ruby1.8 -S rspec spec/classes/init_spec.rb failed* It seems like it can''t load rspec, but if I do ''gem list --local'' it shows in the list of locally installed gems: *vagrant@ubuntu-server-10044-x64-vbox4210-nocm:/modules/couchbase$ gem list --local* * * **** LOCAL GEMS **** * * *diff-lcs (1.2.4)* *metaclass (0.0.1)* *mocha (0.14.0)* *puppet-lint (0.3.2)* *puppetlabs_spec_helper (0.4.1)* *rake (10.1.0)* *rspec (2.14.1)* *rspec-core (2.14.5)* *rspec-expectations (2.14.2)* *rspec-mocks (2.14.3)* *rspec-puppet (0.1.6)* * * Does anyone know why it''s not working? I''ve searched for an answer online, but I''m not overly familiar with ruby, gems, rake, etc and I''m at a bit of a loss. Thanks, Guy -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
As an alternative to the rspec-puppet-init stuff try installing the ''puppetlabs_spec_helper'' gem and then update spec_helper.rb to be: require ''puppetlabs_spec_helper/module_spec_helper'' Then you can just ''rake spec'' and see if that works out better for you. On Fri, Aug 30, 2013 at 6:58 PM, Guy Knights <guy@eastsidegamestudio.com>wrote:> I''m trying to get rspec-puppet working and have run into a problem. I have > a VM running ubuntu lucid, have installed rubygems 1.3.5 from the apt > package and have install rspec-puppet (and other required gems), and rake, > using gem install. > > I''ve run rspec-puppet-init in the module I want to test, and have created > a very basic spec file for one of the classes in my module. However, when I > run ''rake spec'' from the top level of the module directory, I get the > following error: > > *(in /modules/couchbase)* > */usr/bin/ruby1.8 -S rspec spec/classes/init_spec.rb* > */usr/bin/ruby1.8: No such file or directory -- rspec (LoadError)* > */usr/bin/ruby1.8 -S rspec spec/classes/init_spec.rb failed* > > It seems like it can''t load rspec, but if I do ''gem list --local'' it shows > in the list of locally installed gems: > > *vagrant@ubuntu-server-10044-x64-vbox4210-nocm:/modules/couchbase$ gem > list --local* > * > * > **** LOCAL GEMS **** > * > * > *diff-lcs (1.2.4)* > *metaclass (0.0.1)* > *mocha (0.14.0)* > *puppet-lint (0.3.2)* > *puppetlabs_spec_helper (0.4.1)* > *rake (10.1.0)* > *rspec (2.14.1)* > *rspec-core (2.14.5)* > *rspec-expectations (2.14.2)* > *rspec-mocks (2.14.3)* > *rspec-puppet (0.1.6)* > * > * > Does anyone know why it''s not working? I''ve searched for an answer online, > but I''m not overly familiar with ruby, gems, rake, etc and I''m at a bit of > a loss. > > Thanks, > Guy > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscribe@googlegroups.com. > To post to this group, send email to puppet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/puppet-users. > For more options, visit https://groups.google.com/groups/opt_out. >-- Ashley Penney ashley.penney@puppetlabs.com Module Engineer *Join us at PuppetConf 2014, September 23-24 in San Francisco* -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Do I need to replace the entire contents of spec_helper.rb with that file? Also, do I need to change my rake file from the following content? require ''rake'' require ''rspec/core/rake_task'' RSpec::Core::RakeTask.new(:spec) do |t| t.pattern = ''spec/*/*_spec.rb'' end On Fri, Aug 30, 2013 at 4:20 PM, Ashley Penney <ashley.penney@puppetlabs.com> wrote:> As an alternative to the rspec-puppet-init stuff try installing the > ''puppetlabs_spec_helper'' gem and then update spec_helper.rb to be: > > require ''puppetlabs_spec_helper/module_spec_helper'' > > Then you can just ''rake spec'' and see if that works out better for you. > > > On Fri, Aug 30, 2013 at 6:58 PM, Guy Knights <guy@eastsidegamestudio.com>wrote: > >> I''m trying to get rspec-puppet working and have run into a problem. I >> have a VM running ubuntu lucid, have installed rubygems 1.3.5 from the apt >> package and have install rspec-puppet (and other required gems), and rake, >> using gem install. >> >> I''ve run rspec-puppet-init in the module I want to test, and have created >> a very basic spec file for one of the classes in my module. However, when I >> run ''rake spec'' from the top level of the module directory, I get the >> following error: >> >> *(in /modules/couchbase)* >> */usr/bin/ruby1.8 -S rspec spec/classes/init_spec.rb* >> */usr/bin/ruby1.8: No such file or directory -- rspec (LoadError)* >> */usr/bin/ruby1.8 -S rspec spec/classes/init_spec.rb failed* >> >> It seems like it can''t load rspec, but if I do ''gem list --local'' it >> shows in the list of locally installed gems: >> >> *vagrant@ubuntu-server-10044-x64-vbox4210-nocm:/modules/couchbase$ gem >> list --local* >> * >> * >> **** LOCAL GEMS **** >> * >> * >> *diff-lcs (1.2.4)* >> *metaclass (0.0.1)* >> *mocha (0.14.0)* >> *puppet-lint (0.3.2)* >> *puppetlabs_spec_helper (0.4.1)* >> *rake (10.1.0)* >> *rspec (2.14.1)* >> *rspec-core (2.14.5)* >> *rspec-expectations (2.14.2)* >> *rspec-mocks (2.14.3)* >> *rspec-puppet (0.1.6)* >> * >> * >> Does anyone know why it''s not working? I''ve searched for an answer >> online, but I''m not overly familiar with ruby, gems, rake, etc and I''m at a >> bit of a loss. >> >> Thanks, >> Guy >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Puppet Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to puppet-users+unsubscribe@googlegroups.com. >> >> To post to this group, send email to puppet-users@googlegroups.com. >> Visit this group at http://groups.google.com/group/puppet-users. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > > > -- > Ashley Penney > ashley.penney@puppetlabs.com > Module Engineer > > *Join us at PuppetConf 2014, September 23-24 in San Francisco* > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Puppet Users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/puppet-users/l2YHBCvdKF0/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > puppet-users+unsubscribe@googlegroups.com. > To post to this group, send email to puppet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/puppet-users. > For more options, visit https://groups.google.com/groups/opt_out. >-- Guy Knights Lead Systems Administrator <http://eastsidegamestudio.com> www.eastsidegamestudio.com guy@eastsidegamestudio.com <guy@eastsidegamestudio.com> -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Ok, I found the solution - it was a simple case of adding the path to the rspec bin directory to my PATH. Rake is using the -S switch, which uses PATH to find the rspec binary. Thanks, Guy On Fri, Aug 30, 2013 at 4:23 PM, Guy Knights <guy@eastsidegamestudio.com>wrote:> Do I need to replace the entire contents of spec_helper.rb with that file? > Also, do I need to change my rake file from the following content? > > require ''rake'' > > require ''rspec/core/rake_task'' > > RSpec::Core::RakeTask.new(:spec) do |t| > t.pattern = ''spec/*/*_spec.rb'' > end > > > > On Fri, Aug 30, 2013 at 4:20 PM, Ashley Penney < > ashley.penney@puppetlabs.com> wrote: > >> As an alternative to the rspec-puppet-init stuff try installing the >> ''puppetlabs_spec_helper'' gem and then update spec_helper.rb to be: >> >> require ''puppetlabs_spec_helper/module_spec_helper'' >> >> Then you can just ''rake spec'' and see if that works out better for you. >> >> >> On Fri, Aug 30, 2013 at 6:58 PM, Guy Knights <guy@eastsidegamestudio.com>wrote: >> >>> I''m trying to get rspec-puppet working and have run into a problem. I >>> have a VM running ubuntu lucid, have installed rubygems 1.3.5 from the apt >>> package and have install rspec-puppet (and other required gems), and rake, >>> using gem install. >>> >>> I''ve run rspec-puppet-init in the module I want to test, and have >>> created a very basic spec file for one of the classes in my module. >>> However, when I run ''rake spec'' from the top level of the module directory, >>> I get the following error: >>> >>> *(in /modules/couchbase)* >>> */usr/bin/ruby1.8 -S rspec spec/classes/init_spec.rb* >>> */usr/bin/ruby1.8: No such file or directory -- rspec (LoadError)* >>> */usr/bin/ruby1.8 -S rspec spec/classes/init_spec.rb failed* >>> >>> It seems like it can''t load rspec, but if I do ''gem list --local'' it >>> shows in the list of locally installed gems: >>> >>> *vagrant@ubuntu-server-10044-x64-vbox4210-nocm:/modules/couchbase$ gem >>> list --local* >>> * >>> * >>> **** LOCAL GEMS **** >>> * >>> * >>> *diff-lcs (1.2.4)* >>> *metaclass (0.0.1)* >>> *mocha (0.14.0)* >>> *puppet-lint (0.3.2)* >>> *puppetlabs_spec_helper (0.4.1)* >>> *rake (10.1.0)* >>> *rspec (2.14.1)* >>> *rspec-core (2.14.5)* >>> *rspec-expectations (2.14.2)* >>> *rspec-mocks (2.14.3)* >>> *rspec-puppet (0.1.6)* >>> * >>> * >>> Does anyone know why it''s not working? I''ve searched for an answer >>> online, but I''m not overly familiar with ruby, gems, rake, etc and I''m at a >>> bit of a loss. >>> >>> Thanks, >>> Guy >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Puppet Users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to puppet-users+unsubscribe@googlegroups.com. >>> >>> To post to this group, send email to puppet-users@googlegroups.com. >>> Visit this group at http://groups.google.com/group/puppet-users. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >> >> >> >> -- >> Ashley Penney >> ashley.penney@puppetlabs.com >> Module Engineer >> >> *Join us at PuppetConf 2014, September 23-24 in San Francisco* >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Puppet Users" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/puppet-users/l2YHBCvdKF0/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> puppet-users+unsubscribe@googlegroups.com. >> To post to this group, send email to puppet-users@googlegroups.com. >> Visit this group at http://groups.google.com/group/puppet-users. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > > > -- > Guy Knights > Lead Systems Administrator > <http://eastsidegamestudio.com> > www.eastsidegamestudio.com > guy@eastsidegamestudio.com > > <guy@eastsidegamestudio.com> >-- Guy Knights Lead Systems Administrator <http://eastsidegamestudio.com> www.eastsidegamestudio.com guy@eastsidegamestudio.com <guy@eastsidegamestudio.com> -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.