You are set to go now, run the importer: bundle exec script/import_scripts/xenforo.rb
and I get the following:
root@titan-app:/var/www/discourse > RAILS_ENV=production bundle exec ruby script/import_scripts/xenforo.rb
/var/www/discourse/config/application.rb:2:in `require': cannot load such file -- rails/all (LoadError)
from /var/www/discourse/config/application.rb:2:in `<top (required)>'
from /var/www/discourse/config/environment.rb:2:in `require'
from /var/www/discourse/config/environment.rb:2:in `<top (required)>'
from /var/www/discourse/script/import_scripts/base.rb:14:in `require_relative'
from /var/www/discourse/script/import_scripts/base.rb:14:in `<top (required)>'
from script/import_scripts/xenforo.rb:3:in `require'
from script/import_scripts/xenforo.rb:3:in `<main>'
Hey guys, thanks for getting back to me on this issue!
root@titan-app:/var/www/discourse> bundle show railties
Could not find gem 'railties'.
I will admit, I installed the railties gem and then re-ran the above command and got the same result.
root@titan-app:/var/www/discourse> cat `which rails`
#!/usr/local/bin/ruby
#
# This file was generated by RubyGems.
#
# The application 'railties' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
version = ">= 0.a"
if ARGV.first
str = ARGV.first
str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
version = $1
ARGV.shift
end
end
gem 'railties', version
load Gem.bin_path('railties', 'rails', version)
(Note, I got the same result under the ādiscourseā user)
Hi Matt, this is what I got. Should I be running this as the root user within the container or the discourse user?
root@titan-app:/var/www/discourse# bundle install --no-deployment
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
Using mysql2 0.4.4
Using bundler 1.13.0
Bundle complete! 1 Gemfile dependency, 2 gems now installed.
Gems in the group development were not installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
root@titan-app:/var/www/discourse# bundle show railties
Could not find gem 'railties'.
I looked in the Gemfile only to see this in the file:
gem 'mysql2'
So I went to GitHub and got the latest Gemfile and I added the gem 'mysql2' to the file.
Ran bundle install --no-deployment and it installed a BUNCH of stuff (Too many to copy and paste here) (Side note: Do not use tmux and go into the containerā¦it didnāt work at all )
But it ended with this:
Bundle complete! 100 Gemfile dependencies, 180 gems now installed.
Gems in the group development were not installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
Post-install message from certified:
IMPORTANT: Remember to use the included executable `certifed-update` regularly to keep your certificate bundle up to date.
root@titan-app:/var/www/discourse# bundle show railties
/usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1
That looks good in my eyes.
So it looks like the Step 8 in that tutorial above is incorrect.
But when all seems good in the world, I get this:
root@titan-app:/var/www/discourse# bundle exec script/import_scripts/xenforo.rb
bundler: not executable: script/import_scripts/xenforo.rb
Do I need to chmod +x or something? (I donāt have a lot of experience in Ruby to know lol)
Thanks for all the help so far!
EDIT: Chmod Xād the xenforo.rb and now Iām getting this:
root@titan-app:/var/www/discourse# bundle exec script/import_scripts/xenforo.rb
script/import_scripts/xenforo.rb: 1: script/import_scripts/xenforo.rb: require: not found
script/import_scripts/xenforo.rb: 3: script/import_scripts/xenforo.rb: Syntax error: "(" unexpected
As discourse. The console output you pasted says it nice and clearly, too:
Don't run Bundler as root.
Hmm, yeah, thatās never going to end well. Fixed the howto.
Unfortunately, chmod +x wonāt work because the file doesnāt have a āshebangā (#!/usr/bin/ruby or similar) to tell the system what language itās in. Iāve just changed the howto to run ruby explicitly; if you do that, itāll work better (or at least break differently).
Massive thank you for the help @mpalmer. I really appreciate it!
discourse@titan-app:/var/www/discourse$ bundle exec ruby script/import_scripts/xenforo.rb
DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.
Please register a mime type using `register_mime_type` then
use `register_compressor` or `register_transformer`.
https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors
(called from <top (required)> at /var/www/discourse/lib/es6_module_transpiler/sprockets.rb:3)
/usr/local/lib/ruby/2.3.0/fileutils.rb:1392:in `initialize': No such file or directory @ rb_sysopen - /usr/local/lib/ruby/gems/2.3.0/gems/ember-data-source-2.3.0.beta.5/dist/ember-data.js (Errno::ENOENT)
from /usr/local/lib/ruby/2.3.0/fileutils.rb:1392:in `open'
from /usr/local/lib/ruby/2.3.0/fileutils.rb:1392:in `copy_file'
from /usr/local/lib/ruby/2.3.0/fileutils.rb:486:in `copy_file'
from /usr/local/lib/ruby/2.3.0/fileutils.rb:403:in `block in cp'
from /usr/local/lib/ruby/2.3.0/fileutils.rb:1571:in `block in fu_each_src_dest'
from /usr/local/lib/ruby/2.3.0/fileutils.rb:1587:in `fu_each_src_dest0'
from /usr/local/lib/ruby/2.3.0/fileutils.rb:1569:in `fu_each_src_dest'
from /usr/local/lib/ruby/2.3.0/fileutils.rb:402:in `cp'
from /usr/local/lib/ruby/gems/2.3.0/gems/ember-rails-0.18.5/lib/ember_rails.rb:68:in `block in <class:Railtie>'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in `instance_exec'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in `run'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /usr/local/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
from /usr/local/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /usr/local/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /usr/local/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /usr/local/lib/ruby/2.3.0/tsort.rb:347:in `each'
from /usr/local/lib/ruby/2.3.0/tsort.rb:347:in `call'
from /usr/local/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
from /usr/local/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
from /usr/local/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:54:in `run_initializers'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/application.rb:352:in `initialize!'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/railtie.rb:194:in `public_send'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.7.1/lib/rails/railtie.rb:194:in `method_missing'
from /var/www/discourse/config/environment.rb:5:in `<top (required)>'
from /var/www/discourse/script/import_scripts/base.rb:14:in `require_relative'
from /var/www/discourse/script/import_scripts/base.rb:14:in `<top (required)>'
from script/import_scripts/xenforo.rb:3:in `require'
from script/import_scripts/xenforo.rb:3:in `<main>'
It looks like now that I am missing gems or something needs to be definedā¦
I think that on this overwrite Gemfile thing, youāve got some incompatible bundle. I would try a rebuild to get things back to a working state. Backup all manual changes inside the container before, itās gonna be wiped.