Note that there are some explanatory texts on larger screens.

plurals
  1. POTo what value PATH variable must be set for using Rspec with Ruby on Rails?
    text
    copied!<p>I am having problem with setting PATH variable in Ruby on Rails. Constraints are: I have to use Ruby 1.8.7 and Rails 2.2.2 and Rubygems 1.3.5. These are the outputs of commands:</p> <pre><code>hemant@hemant-laptop:~$ which gem /usr/bin/gem hemant@hemant-laptop:~$ which ruby /usr/local/bin/ruby hemant@hemant-laptop:~$ which rails /var/lib/gems/1.8/bin/rails hemant@hemant-laptop:~$ gem env RubyGems Environment: - RUBYGEMS VERSION: 1.3.5 - RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [i486-linux] - INSTALLATION DIRECTORY: /var/lib/gems/1.8 - RUBY EXECUTABLE: /usr/bin/ruby1.8 - EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin - RUBYGEMS PLATFORMS: - ruby - x86-linux - GEM PATHS: - /var/lib/gems/1.8 - /home/hemant/.gem/ruby/1.8 </code></pre> <p>I have added these lines into my <code>.bashrc</code> file:</p> <pre><code>export PATH=$PATH:/var/lib/gems/1.8/bin export PATH=$PATH:/usr/bin/gem </code></pre> <p>When I echo PATH variable:</p> <pre><code>hemant@hemant-laptop:~$ echo $PATH </code></pre> <p><code>usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:bin:/usr/games:/var/lib/gems/1.8/bin:/usr/bin/gem</code></p> <p>Real problem is that when I run <code>script/server</code> in my rails app directory, It errors:</p> <p><code>./script/../config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:1:in 'require': no such file to load -- rubygems (LoadError)</code> </p> <p>When I googled it, I got to know that it is due to flaw in <code>PATH</code> variable configuration, but I can't understand what value I should give to it. The above two <code>export</code> statements are just hit and trials but they didn't solve the problem.</p> <p>Can someone please guide me what value <code>PATH</code> must be set to and how one can deduce the value from outputs of various commands.</p> <p><strong>[EDIT]</strong> </p> <p>Running <code>gem list</code> gives this:</p> <pre><code>actionmailer (2.2.2) actionpack (2.2.2) activerecord (2.2.2) activeresource (2.2.2) activesupport (2.2.2) chronic (0.10.2) diff-lcs (1.2.4) image_science (1.2.1) libv8 (3.16.14.3) mysql (2.9.1) rack (1.5.2) rails (2.2.2) rake (0.8.7) ref (1.0.5) rspec (1.2.9) rspec-core (2.14.6) rspec-expectations (2.14.0) rspec-mocks (2.14.4) rspec-rails (1.2.9) rubygems-update (2.1.10) therubyracer (0.12.0) ZenTest (4.3.0) </code></pre>
 

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