Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: uninitialized constant Typescript::Rails::Compiler (While attempting to precompile Rails 4.2 assets) #32

Open
ghost opened this issue Oct 15, 2015 · 2 comments

Comments

@ghost
Copy link

ghost commented Oct 15, 2015

Hello,

This worked fine in Rails 4.2 and Ruby 2.1.4, but now I'm using Rails 4.2 and Ruby 2.2.0.

Any help on this problem is greatly appreciated.

Thank you,


Terminal result:

ubuntu@ip:~/app$ RAILS_ENV=production bundle exec rake assets:precompile
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
[DEPRECATION] requiring "RMagick" is deprecated. Use "rmagick" instead
DEPRECATION WARNING: The configuration option config.serve_static_assets has been renamed to config.serve_static_files to clarify its role (it merely enables serving everything in the public folder and is unrelated to the asset pipeline). The serve_static_assets alias will be removed in Rails 5.0. Please migrate your configuration files accordingly. (called from block in <top (required)> at /home/ubuntu/app/config/environments/production.rb:24)
rake aborted!
NameError: uninitialized constant Typescript::Rails::Compiler
/home/ubuntu/.rvm/gems/ruby-2.2.0/gems/typescript-rails-0.6.2/lib/typescript/rails/template.rb:25:in evaluate' /home/ubuntu/.rvm/gems/ruby-2.2.0/gems/tilt-2.0.1/lib/tilt/template.rb:96:inrender'
/home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/legacy_tilt_processor.rb:25:in call' /home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/processor_utils.rb:75:incall_processor'
/home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/processor_utils.rb:57:in block in call_processors' /home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/processor_utils.rb:56:inreverse_each'
/home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/processor_utils.rb:56:in call_processors' /home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/loader.rb:134:inload_from_unloaded'
/home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/loader.rb:60:in block in load' /home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/loader.rb:318:infetch_asset_from_dependency_cache'
/home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/loader.rb:44:in load' /home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/cached_environment.rb:20:inblock in initialize'
/home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/cached_environment.rb:47:in yield' /home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/cached_environment.rb:47:inload'
/home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/bundle.rb:23:in block in call' /home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/utils.rb:183:indfs'
/home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/bundle.rb:24:in call' /home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/processor_utils.rb:75:incall_processor'
/home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/processor_utils.rb:57:in block in call_processors' /home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/processor_utils.rb:56:inreverse_each'
/home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/processor_utils.rb:56:in call_processors' /home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/loader.rb:134:inload_from_unloaded'
/home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/loader.rb:60:in block in load' /home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/loader.rb:318:infetch_asset_from_dependency_cache'
/home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/loader.rb:44:in load' /home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/cached_environment.rb:20:inblock in initialize'
/home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/cached_environment.rb:47:in yield' /home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/cached_environment.rb:47:inload'
/home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/base.rb:66:in find_asset' /home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/base.rb:73:infind_all_linked_assets'
/home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/manifest.rb:130:in block in find' /home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/manifest.rb:129:ineach'
/home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/manifest.rb:129:in find' /home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/sprockets/manifest.rb:162:incompile'
/home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/task.rb:70:in block (3 levels) in define' /home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-3.4.0/lib/rake/sprocketstask.rb:147:inwith_logger'
/home/ubuntu/.rvm/gems/ruby-2.2.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/task.rb:69:in `block (2 levels) in define'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

@bdrazhzhov
Copy link
Member

Hello @atteeela,
Could you find out more details? I tried to compile my own assets in my projects with ruby 2.2.0 and it was done without any error. But I would like to re-produce this error to know what is a source of your issue.

@ichiro101
Copy link

This issue is caused by the nodejs dependency on the latest version of Ubuntu/Debian. This is because nodejs executable is now called /usr/bin/nodejs rather than /usr/bin/node and this gem is only looking for node executable in the PATH rather than nodejs as well. You can fix this by sudo apt-get install nodejs-legacy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants