require lib in RSpec with Ruby 1.9.2 brings no such file to load
The load path in ruby 1.9 doesn't work exactly like it did in 1.8.
You need to add the project's root directory to your load path.
You can do this by either running rspec like this:
rspec -I . ./spec/models/tipp_remember_spec.rb
...or by manually adding stuff to the load path in your spec_helper.rb
(put this at the top of your spec_helper.rb
$:<< File.join(File.dirname(__FILE__), '..')
I think rspec by default adds your local lib
directory to the load path as well, so you might be able to rewrite the require line as follows instead:
require 'services/my_lib'
`require': cannot load such file
You should use require_relative:
require_relative 'mixins2'
ImageUtils.status
Ssetting up rspec2 task in Rakefile
The syntax looks fine to me. Are you 100% sure you have rspec 2
installed? Does it appear with gem which rspec
? Maybe you forgot to run bundle install
or you don't list rspec
in the .gemspec
file as a (development) dependency?
Ruby Strange Error
Rubygems is installed with ruby 1.9 by default.
Check that the file you are trying to load is in a directory listed in the variable $: or specify the entire path to the file in the require. Or, add the directory to $: explicitly:
$: << '/my/lib/path'
require 'mylib'
Related Topics
What Is Purpose of Around_Create Callback in Rails Model
Example of a Prepared Insert Statement Using Ruby Pg Gem
How to Properly Chain Custom Methods in Ruby
What Are the Limitations of Opal
How to Push Keys and Values into an Empty Hash W/ Ruby
Map an Array Modifying Only Elements Matching a Certain Condition
Split Array Up into N-Groups of M Size
Does Concurrency Happen Even When Only One Thread Is in a Thread Pool
Connect to Tor Network with Ruby
How to Resolve Deprecation Warnings for Openssl::Cipher::Cipher#Encrypt
How to Pass a Variable to a Layout
Accessing One Controller Variable in Another Controller in Rails