Quick Start Issues: File Generation
Ubuntu Server 14.04.1 LTS Managed to get a development instance of canvas running on localhost using the Quick Start instructions, but links for "Edit Settings", "Start a New Course", "Add Email Address" and other functions do not work. The actual href for these is "#" and there is no compiled javascript in public/javascripts directory.
I did have errors when I tried to compile assets:
~/canvas$ npm install
~/canvas$ $GEM_HOME/bin/bundle exec rake canvas:compile_assets
npm install and canvas:compile_assets had a number of deprecation warnings...
~/canvas$ $GEM_HOME/bin/bundle exec rake canvas:compile_assets
resulted in the following errors:
Building client app 'canvas_quiz_statistics'
Running 'npm install'...
npm WARN deprecated [email protected]: Please update to the latest version; it overrides noncompliant native methods even in modern implementations
npm ERR! Error: EACCES, mkdir '/home/alex/.npm/coffee-script/1.3.3/package'
npm ERR! { [Error: EACCES, mkdir '/home/alex/.npm/coffee-script/1.3.3/package']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/home/alex/.npm/coffee-script/1.3.3/package',
npm ERR! parent: 'grunt' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.13.0-32-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/alex/canvas/client_apps/canvas_quiz_statistics
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! path /home/alex/.npm/coffee-script/1.3.3/package
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/home/alex/.npm/coffee-script/1.3.3/package'
npm ERR! not ok code 0
-------------------------------------------------------------------
INSTALL FAILURE:
-------------------------------------------------------------------
rake aborted!
Undumpable Exception -- #<RuntimeError: Package installation failure for client app canvas_quiz_statistics>
Hi marpa You need to use sudo: "sudo npm install" Problem with "#" is because you didn't use canvas:compile_assets rake task.
jorgevbo,
Thanks for assistance. Here's what I get when I run sudo npm install
alex@ubuntu:~/canvas$ sudo npm install
[sudo] password for alex:
npm WARN package.json [email protected] No README data
npm WARN package.json [email protected] No README data
npm WARN package.json [email protected] No README data
npm WARN package.json [email protected] No README data
npm WARN prefer global [email protected] should be installed with -g
alex@ubuntu:~/canvas$ sudo npm install -g coffee-script
/usr/bin/coffee -> /usr/lib/node_modules/coffee-script/bin/coffee
/usr/bin/cake -> /usr/lib/node_modules/coffee-script/bin/cake
[email protected] /usr/lib/node_modules/coffee-script
└── [email protected]
After running sudo npm install I then ran
$GEM_HOME/bin/bundle exec rake canvas:compile_assets
I ran this 2x, 1st as not sudo and then as sudo. When I ran this as sudo, I got a LoadError (see below)
alex@ubuntu:~/canvas$ $GEM_HOME/bin/bundle exec rake canvas:compile_assets --trace
/home/alex/canvas/gems/utf8_cleaner/lib/utf8_cleaner.rb:20:in `<top (required)>': iconv will be deprecated in the future, use String#encode instead.
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /home/alex/canvas/Rakefile:11)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /home/alex/canvas/Rakefile:11)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /home/alex/canvas/Rakefile:11)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /home/alex/canvas/Rakefile:11)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /home/alex/canvas/Rakefile:11)
** Invoke canvas:compile_assets (first_time)
** Execute canvas:compile_assets
working in 1 processes
--> Starting: 'Compile sass and make jammit css bundles'
--> Starting: 'npm run compile-sass'
> [email protected] compile-sass /home/alex/canvas
> node script/compile-sass.js
--> Finished: 'npm run compile-sass' in 106.917129608
--> Starting: 'Jammit'
--> Finished: 'Jammit' in 1.220066955
--> Finished: 'Compile sass and make jammit css bundles' in 108.140129498
--> Starting: 'css:styleguide'
** Invoke css:styleguide (first_time)
** Execute css:styleguide
--> creating styleguide
# writing file: app/views/info/styleguide.html.erb
--> Finished: 'css:styleguide' in 5.491732328
--> Starting: 'compile coffee, js 18n, and run r.js optimizer'
--> Starting: 'js:generate'
** Invoke js:generate (first_time)
** Execute js:generate
** Invoke js:build_client_apps (first_time)
** Execute js:build_client_apps
Building client app 'canvas_quiz_statistics'
Running 'npm install'...
npm WARN deprecated [email protected]: Please update to the latest version; it overrides noncompliant native methods even in modern implementations
npm ERR! Error: EACCES, mkdir '/home/alex/.npm/coffee-script/1.3.3/package'
npm ERR! { [Error: EACCES, mkdir '/home/alex/.npm/coffee-script/1.3.3/package']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/home/alex/.npm/coffee-script/1.3.3/package',
npm ERR! parent: 'grunt' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.13.0-32-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/alex/canvas/client_apps/canvas_quiz_statistics
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! path /home/alex/.npm/coffee-script/1.3.3/package
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/home/alex/.npm/coffee-script/1.3.3/package'
npm ERR! not ok code 0
-------------------------------------------------------------------
INSTALL FAILURE:
-------------------------------------------------------------------
rake aborted!
Undumpable Exception -- #<RuntimeError: Package installation failure for client app canvas_quiz_statistics>
/home/alex/gems/gems/parallel-0.5.16/lib/parallel.rb:173:in `work_in_processes'
/home/alex/gems/gems/parallel-0.5.16/lib/parallel.rb:55:in `map'
/home/alex/canvas/lib/tasks/canvas.rake:154:in `block (3 levels) in <top (required)>'
/usr/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
/home/alex/canvas/lib/tasks/canvas.rake:153:in `block (2 levels) in <top (required)>'
/home/alex/gems/gems/rake-10.3.2/lib/rake/task.rb:240:in `call'
/home/alex/gems/gems/rake-10.3.2/lib/rake/task.rb:240:in `block in execute'
/home/alex/gems/gems/rake-10.3.2/lib/rake/task.rb:235:in `each'
/home/alex/gems/gems/rake-10.3.2/lib/rake/task.rb:235:in `execute'
/home/alex/gems/gems/rake-10.3.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/usr/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/alex/gems/gems/rake-10.3.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/home/alex/gems/gems/rake-10.3.2/lib/rake/task.rb:165:in `invoke'
/home/alex/gems/gems/rake-10.3.2/lib/rake/application.rb:150:in `invoke_task'
/home/alex/gems/gems/rake-10.3.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/home/alex/gems/gems/rake-10.3.2/lib/rake/application.rb:106:in `each'
/home/alex/gems/gems/rake-10.3.2/lib/rake/application.rb:106:in `block in top_level'
/home/alex/gems/gems/rake-10.3.2/lib/rake/application.rb:115:in `run_with_threads'
/home/alex/gems/gems/rake-10.3.2/lib/rake/application.rb:100:in `top_level'
/home/alex/gems/gems/rake-10.3.2/lib/rake/application.rb:78:in `block in run'
/home/alex/gems/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/alex/gems/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
/home/alex/gems/gems/rake-10.3.2/bin/rake:33:in `<top (required)>'
/home/alex/gems/bin/rake:23:in `load'
/home/alex/gems/bin/rake:23:in `<main>'
Tasks: TOP => canvas:compile_assets
alex@ubuntu:~/canvas$ sudo $GEM_HOME/bin/bundle exec rake canvas:compile_assets --trace
/home/alex/gems/bin/bundle:23:in `load': cannot load such file -- /usr/share/rubygems-integration/1.9.1/gems/bundler-1.3.5/bin/bundle (LoadError)
from /home/alex/gems/bin/bundle:23:in `<main>'
Have confirmed the a number of javascript files are missing (i.e. the public/javascripts/compiled directory is missing) and the "Edit Settings", "Start a New Course" still do not work.
I feel like I'm really close... Why can't /usr/share/rubygems-integration/1.9.1/gems/bundler-1.3.5/bin/bundle be loaded?
I was finally able to generate files with the canvas:compile_assets rake task. I think all of my problems were the result of incorrect permissions. In particular, most of the directories within .npm were owned by me, but some were owned by root including /home/alex/.npm/coffee-script/1.3.3/. The fix was to simply change the owner of all files within .npm to me
.npm$ sudo chown -R alex:alex .*
The Quick Start instructions indicate that coffee-script should be installed as sudo:
$ sudo npm install -g [email protected]
Not sure if this caused the issue...
At one point I also ran:
~/canvas$ sudo npm install -g coffee-script
Maybe this caused some issues... When I cd'ed into the coffee-script directory all the packages were owned by me EXCEPT 1.3.3