Docker setup on Ubuntu
I ran the INK docker setup on the Linux in the Coko office, running Ubuntu 16.04 LTS. The main takeaway is that I ended up hitting the same basic issue as #5 (closed): Rails keeps trying to start in an development environment, rather than production. So fixing that is still the priority.
It might be all very naive, but I'm leaving what I did here in case it's helpful.
gpg --keyserver command throws errors
I'm not sure if these caused any problems down the road, or these are expected, but I got these errors in the terminal:
coko@coko:~/Desktop/ink-docker$ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB gpg: requesting key D39DC0E3 from hkp server keys.gnupg.net gpg: requesting key 39499BDB from hkp server keys.gnupg.net gpgkeys: key 7D2BAF1CF37B13E2069D6956105BD0E739499BDB can't be retrieved gpg: key D39DC0E3: public key "Michal Papis (RVM signing) <firstname.lastname@example.org>" imported gpg: no ultimately trusted keys found gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1) gpg: keyserver communications error: keyserver helper general error gpg: keyserver communications error: unknown pubkey algorithm gpg: keyserver receive failed: unknown pubkey algorithm
2. Had to install Ruby after installing rvm
The rvm install fine with this, but not ruby 2.2.3:
\curl -sSL https://get.rvm.io | bash -s stable --ruby=2.2.3 source /usr/local/rvm/scripts/rvm
rvm ls after that showed no Rubies installed. Installing Ruby 2.2.3 was easy with rvm though.
gem install bundler seemed to work fine, too, but I hit issues with it later:
coko@coko:~/Desktop/ink-docker$ gem install bundler Fetching: bundler-1.15.4.gem (100%) Successfully installed bundler-1.15.4 Parsing documentation for bundler-1.15.4 Installing ri documentation for bundler-1.15.4 Done installing documentation for bundler after 4 seconds 1 gem installed
#3 (closed). docker daemon issues
docker and docker-compose install, but they throw some daemon and
runit errors. Then, after cloning the repo and running the
create-env script, the next two docker commands fail.
docker volume create --name gems returns
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
sudo docker volume create --name gems` succeeds.
./bin/docker also throws daemon errors:
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running? If it's at a non-standard location, specify the URL with the DOCKER_HOST environment
sudo ./bin/docker succeeded, but I needed to run it 3 times before it finished all the way - see the attached log.
4. Working directory changes
sudo ./bin/docker successfully changed the working directory to
root@927de8fc5d01:/app# - see the docker_install log above. So, I just left it open and switched to a new terminal back in the previous working directory.
5. bundler install errors
Here's the log for the new terminal window through the end: terminal2.txt
I tried to
bundle but got an error that
bundle wasn't installed:
The program 'bundle' is currently not installed. You can install it by typing: sudo apt install ruby-bundler
So then I ran
sudo apt install ruby-bundler but got some of the same
runit and daemon errors from earlier:
Errors were encountered while processing: runit git-daemon-run E: Sub-process /usr/bin/dpkg returned an error code (1)
Consulted the internet and then ran these commands for a fix:
sudo apt-get purge runit sudo apt-get purge git-all sudo apt-get purge git sudo apt-get autoremove sudo apt update sudo apt install git
sudo apt install ruby-bundler worked.
6. bundling errors
Once bundler was installed, I tried to
bundle again. I got a bunch of errors (
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.) and the process stopped with:
An error occurred while installing nio4r (1.2.1), and Bundler cannot continue. Make sure that `gem install nio4r -v '1.2.1'` succeeds before bundling.
So I ran
sudo gem install nio4r -v '1.2.1' (it needed
sudo). That failed:
Building native extensions. This could take a while... ERROR: Error installing nio4r: ERROR: Failed to build gem native extension. current directory: /var/lib/gems/2.3.0/gems/nio4r-1.2.1/ext/nio4r /usr/bin/ruby2.3 -r ./siteconf20171012-23703-w6ckxz.rb extconf.rb mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h extconf failed, exit code 1 Gem files will remain installed in /var/lib/gems/2.3.0/gems/nio4r-1.2.1 for inspection. Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/nio4r-1.2.1/gem_make.out
Fix from the internet:
sudo apt-get install ruby-dev
bundle again, and
nio4r-1.2.1 installed fine, but postgres failed:
An error occurred while installing pg (0.20.0), and Bundler cannot continue. Make sure that `gem install pg -v '0.20.0'` succeeds before bundling.
I tried a few things but the fix seemed to be
sudo apt-get install libpq-dev. Then, pg installed, and
And that's where we're back to #5 (closed) - things running in development when we'd expect them running in production.