There seems to be some exception to the instructions no matter which Ubuntu version I used. (I've tried 12.04, 14.04). For the official instruction using 12.04 (our system is Ubuntu Linux 12.04.5; Linux 2.6.32-042stab113.21 on x86_64), I am following the production script almost to the T. No matter what I do, something seems to go wrong.
Any help is appreciative!
The problems:
Firstly, the version of bundler is wrong and it won't continue with version 1.7.11 (version 1.8.0 or later is required).
sysadmin@appserver:/var/canvas$ sudo gem install bundler --version 1.7.11
sysadmin@appserver:/var/canvas$ bundle install --path vendor/bundle
Once I removed 1.711 and ran sudo gem install bundler --version 1.8.0, things moved on.
The next real problem is with: npm install
There are all kinds of warnings in the npm install for deprecated packages. But, the npm install did ultimately fail (see snipped below, full log attached). Since it said Binary is fine; exiting. I thought by some chance this was ok.
Following that, RAILS_ENV=production bundle exec rake canvas:compile_assets has errors during configuration and then aborts all together.
- First, it encounter an error on tar (child): bzip2: Cannot exec: No such file or directory, but continued.
- Then the script halted on: /var/canvas/vendor/bundle/ruby/2.1.0/bundler/gems/dress_code-574382160ee4/lib/dress_code/extractor.rb:31:in `scan': invalid byte sequence in US-ASCII (ArgumentError)
npm fail log:
` /var/canvas/node_modules/brandable_css/node_modules/node-sass/vendor/linux-x64-14/binding.node ` exists.
testing binary.
Binary is fine; exiting.
npm ERR! Linux 2.6.32-042stab113.21
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v0.12.15
npm ERR! npm v2.15.1
npm ERR! code ELIFECYCLE
npm ERR! phantomjs...@2.1.7 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs...@2.1.7 install script 'node install.js'.
npm ERR! This is most likely a problem with the phantomjs-prebuilt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs phantomjs-prebuilt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls phantomjs-prebuilt
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /var/canvas/npm-debug.log
First rake error:
--> Starting: 'Making sure node_modules are up to date'
Error extracting archive
Phantom installation failed { [Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
tar (child): bzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
Last rake error::
--> creating styleguide
/var/canvas/vendor/bundle/ruby/2.1.0/bundler/gems/dress_code-574382160ee4/lib/dress_code/extractor.rb:31:in `scan': invalid byte sequence in US-ASCII (ArgumentError)
from /var/canvas/vendor/bundle/ruby/2.1.0/bundler/gems/dress_code-574382160ee4/lib/dress_code/extractor.rb:31:in `scan'
from /var/canvas/vendor/bundle/ruby/2.1.0/bundler/gems/dress_code-574382160ee4/lib/dress_code/extractor.rb:25:in `parse_file'
from /var/canvas/vendor/bundle/ruby/2.1.0/bundler/gems/dress_code-574382160ee4/lib/dress_code/extractor.rb:20:in `block in parse_files'
from /var/canvas/vendor/bundle/ruby/2.1.0/bundler/gems/dress_code-574382160ee4/lib/dress_code/extractor.rb:20:in `each'
from /var/canvas/vendor/bundle/ruby/2.1.0/bundler/gems/dress_code-574382160ee4/lib/dress_code/extractor.rb:20:in `flat_map'
from /var/canvas/vendor/bundle/ruby/2.1.0/bundler/gems/dress_code-574382160ee4/lib/dress_code/extractor.rb:20:in `parse_files'
from /var/canvas/vendor/bundle/ruby/2.1.0/bundler/gems/dress_code-574382160ee4/lib/dress_code/extractor.rb:15:in `extract'
from /var/canvas/vendor/bundle/ruby/2.1.0/bundler/gems/dress_code-574382160ee4/bin/dress_code:88:in `<top (required)>'
from bin/dress_code:16:in `load'
from bin/dress_code:16:in `<main>'
rake aborted!
Undumpable Exception -- #<RuntimeError: error running dress_code>
/var/canvas/vendor/bundle/ruby/2.1.0/gems/parallel-1.4.1/lib/parallel.rb:63:in `work'
/var/canvas/vendor/bundle/ruby/2.1.0/gems/parallel-1.4.1/lib/parallel.rb:280:in `block (4 levels) in work_in_processes'
/var/canvas/vendor/bundle/ruby/2.1.0/gems/parallel-1.4.1/lib/parallel.rb:447:in `with_instrumentation'
/var/canvas/vendor/bundle/ruby/2.1.0/gems/parallel-1.4.1/lib/parallel.rb:279:in `block (3 levels) in work_in_processes'
/var/canvas/vendor/bundle/ruby/2.1.0/gems/parallel-1.4.1/lib/parallel.rb:273:in `loop'
/var/canvas/vendor/bundle/ruby/2.1.0/gems/parallel-1.4.1/lib/parallel.rb:273:in `block (2 levels) in work_in_processes'
/var/canvas/vendor/bundle/ruby/2.1.0/gems/parallel-1.4.1/lib/parallel.rb:138:in `block (2 levels) in in_threads'
Tasks: TOP => canvas:compile_assets
(See full trace by running task with --trace)