Note that there are some explanatory texts on larger screens.

plurals
  1. PORunning Rspec from an entirely different sinatra app?
    primarykey
    data
    text
    <p>I'm currently trying to run a sinatra framework that downloads code from a repo, executes rspec on the code and then processes the results from RSpec. However, I'm having trouble getting rspec to run when i call it from a different application. </p> <p>I keep getting the following error:</p> <pre><code>/Users/dir/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/rubygems_integration.rb:147:in `block in replace_gem': rspec-core is not part of the bundle. Add it to Gemfile. (Gem::LoadError) from /Users/dir/.rvm/gems/ruby-1.9.3-p194/bin/rspec:22:in `&lt;main&gt;' </code></pre> <p>After running tons of output, it basically boils down ruby not switching to the correct directory before executing bundle exec. I've tried just about anything to get it to work with no success... It seems even if I change the directory, it will continue to attempt to run RSpec on the application i'm on, rather than the one i want to do it.</p> <pre><code> Dir.chdir('../target_app'){ exe = "bundle exec rspec spec" `#{exe}` } </code></pre> <p>I've also tried backticks, exec and system() like this with no success.</p> <pre><code>`cd ../target_app &amp;&amp; bundle exec rspec spec` </code></pre> <p>I have also tried things like ChildProcess with no success:</p> <pre><code> p = ChildProcess.build('bundle', 'exec', 'rspec', 'spec') p.io.inherit! p.cwd = '../target_app' p.start </code></pre> <p>Any clue or help on how to solve this would be greatly appreciated!</p> <p>Edit: </p> <p>I've also tried <code>bundle install --binstub --path vendor</code></p> <p>with this code: </p> <pre><code> Dir.chdir('../target_app'){ puts `pwd`.chomp exe = "bin/rspec spec -o ../tmp.txt" puts exe `#{exe}` } </code></pre> <p>I get this output: </p> <pre><code>/Users/me/dev/target_app bin/rspec spec -o ../tmp.txt /Users/me/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/rubygems_integration.rb:223:in `block in replace_bin_path': can't find executable rspec (Gem::Exception) from bin/rspec:16:in `&lt;main&gt;' </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload