I want to access MySQL through ruby on a shared linux server. I suppose I need to use the DBI module, but I cannot access it. I installed it as follows:
gem install -r dbi
He could not install it in the usual place, because I am on a shared server and do not have permission:
WARNING: Installing to ~/.gem since /usr/lib/ruby/gems/1.8 and
/usr/bin aren't both writable.
WARNING: You don't have ~/.gem/ruby/1.8/bin in your PATH,
gem executables will not run.
It seemed to be successfully installed.
However, now when I try to execute it, I just get an error message. So my code is simple:
require 'dbi'
and this gives the following error:
dbi_test.rb:1:in `require': no such file to load
from dbi_test.rb:1
I tried to set the environment variable LOAD_PATH to the directory where dbi.rb is located, but that didn't make any difference.
source
share