How can use external gem w/ vagrant

129 views
Skip to first unread message

Joaquin Menchaca

unread,
Apr 25, 2016, 3:04:55 PM4/25/16
to Vagrant
I am stuck on this one.  I wanted to store some data in either INI file or SQLite3 database.  I would query these, then build a Ruby hash.   

Unfortunately, I get errors

require 'inifile'
settings = IniFile.load(CONFIGFILE)

Message: LoadError: cannot load such file -- inifile


require 'sqlite3'
File.delete(CONFIGFILE_DB) if File.exist?(CONFIGFILE_DB)
db = SQLite3::Database.new(CONFIGFILE_DB)
db = execute( ".read #{CONFIGFILE_SQL}")
db.execute( QUERY_HOSTS ) do |hostname, ipaddr|
  settings['hosts'][hostname] = ipaddr
end

Message: LoadError: cannot load such file -- sqlite3


So, how can I get these gems to be available when my Vagrantfile is included.

Joaquin Menchaca

unread,
Apr 25, 2016, 3:50:53 PM4/25/16
to Vagrant
I found that I can get these to work if I do:

vagrant plugin install sqlite3

vagrant plugin install inifile


Now I am wondering if there's a way to have something stupid-simple, like bundle install with a Gemfile.


I did not see anything obvious.  


There's some material about using development version of vagrant:

But nothing end-user-ish... as far as I know.  Anyone know if there is easy do automate this (vagrant plugin install).




Reply all
Reply to author
Forward
0 new messages