mastodon / mastodon-ansible

Ansible playbook for installing Mastodon
MIT License
166 stars 60 forks source link

Playbook runs fine on Debian stretch, what next -> Ruby problems #6

Closed linuxmail closed 6 years ago

linuxmail commented 6 years ago

Hello,

I'm new to Ansible and was able to run it and it seems, all went fine. Now I'm stuck a bit, because of Gem wants to install to /usr/lib/.... but its not allowed as user Mastodon.

I started with the prduction guide on "Dependencies That Need To Be Added As A Non-Root User"

mastodon@mammoth:~/live$ gem install bundler
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/lib/rbenv/versions/2.5.1/lib/ruby/gems/2.5.0 directory.

So, I'm asking, if I have to use "su" (which won't work too, because of missing path) or tell gem to make use of --user-install ... but

gem install --user-install bundler
WARNING:  You don't have /home/mastodon/.gem/ruby/2.5.0/bin in your PATH,
      gem executables will not run.
rbenv: cannot rehash: /usr/lib/rbenv/shims isn't writable
Successfully installed bundler-1.16.3
Parsing documentation for bundler-1.16.3
Done installing documentation for bundler after 2 seconds
1 gem installed

so, bundler works in the end, but fails with installing the dependencies, because of missing path ...

I think, to mix Ruby install on /usr/lib/* and doing "things" as user "mastodon" won't work in this way :-)

I played a bit more and added the PATH "/home/mastodon/.gem/ruby/2.5.0/bin" to the $PATH ... just for fun and a bit later:

Installing cld3 3.2.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/cld3-3.2.2/ext/cld3
/usr/lib/rbenv/versions/2.5.1/bin/ruby -r ./siteconf20180819-2252-1u06vfn.rb extconf.rb
Failed to locate protobuf

cu denny

dracos commented 6 years ago

bundler was already installed by the playbook: https://github.com/tootsuite/mastodon-ansible/blob/32d2eb7be4a35c44fb146c605f6389d6cc0d6104/bare/roles/web/tasks/ruby.yml#L64 You need to activate your rbenv and then gem will install locally to that, without sudo or --user-install.

Your later error is because this playbook doesn't install protobuf, which is listed as necessary on https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Production-guide.md . Looks to be a few issues; I am having more luck with https://github.com/staticsafe/mastible .

bitboxer commented 6 years ago

@linuxmail are you still having troubles?

linuxmail commented 6 years ago

hi,

let me try it in a few days again, on a second server, than I can tell you, if it works as expected. I needed more ram, for new VMs :-)

moritzheiber commented 6 years ago

@linuxmail I'm going to close this for now, please feel free to re-open it if this problem prevails. Thanks!