Hi,
I am trying to import data from Phorum database. I have filled db data to the phorum.rb script (mysql name, pass, db name) and tried to run the script with: ruby script/import_scripts/phorum.rb
but it failed with this error:
/var/discourse/script/import_scripts/base.rb:14:in `require_relative': cannot load such file --
/var/discourse/config/environment (LoadError)
from /var/discourse/script/import_scripts/base.rb:14:in `<top (required)>'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:in `require'
from script/import_scripts/phorum.rb:3:in `<main>'
I am not sure if it’s production server (I’ve followed Discourse installation guide here) and if I try to run command you’ve mentioned it ends with: Could not locate Gemfile (even if I try it from directory with phorum.rb).
Command to start was: su root -c 'bundle exec ruby script/import_scripts/phorum.rb' from /var/discourse. I have Vagrantfile there but really no Gemfile.
I tried: git reset HEAD --hard git pull ./launcher rebuild app bundle exec ruby script/import_scripts/phorum.rb as root
Still no Gemfile. I forgot to mention that I always have to modify launcher, because it detects uppercase characters, spaces or special characters in app, so I just comment out exit 1 line.
Ok, some progress at least. I’ve manually downloaded Gemfile and did bundle install but right now it’s ending because of: script/import_scripts/phorum.rb:1:inrequire’: cannot load such file – mysql2`
/var/discourse/script/import_scripts/base.rb:14:in `require_relative': cannot load such file -- /var/discourse/config/environment (LoadError)
from /var/discourse/script/import_scripts/base.rb:14:in `<top (required)>'
from script/import_scripts/phorum.rb:3:in `require'
from script/import_scripts/phorum.rb:3:in `<main>'
If I compare directories on github and in /var/discourse I have missing a lot of them (I don’t know how that’s possible). Shouldn’t I try to remove entire /var/discourse and download it again?