Comments (27)
I've used both gems in a project without problems. What JS runtime are you using? I suggest to test with the Ruby racer by uncomment gem 'therubyracer'
or install NodeJS.
from haml_coffee_assets.
I tried to install therubyracer gem: error
I think it's because my platform is windows.
from haml_coffee_assets.
According to the error message it needs Python for building libv8. The other option is to use install NodeJS, they have a windows installer. You can verify the ExecJS runtime in the console:
$ irb
> require 'execjs'
> ExecJS.runtime
=> #<ExecJS::RubyRacerRuntime:0x007fae2b0ba6b8>
from haml_coffee_assets.
Ok, I installed NodeJS
verify the ExecJS
But, error is still exist.
from haml_coffee_assets.
Somehow the output here is missing the info, but I got it in the notification email:
irb(main):001:0> require 'execjs'
=> true
irb(main):002:0> ExecJS.runtime
=> #<ExecJS::ExternalRuntime:0x2386db8 @name="JScript", @command="cscript //E:jscript //Nologo //U", @runner_path="C:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-1.3.0/lib/execjs/support/jscript_runner.js", @test_args=nil, @test_match=nil, @encoding="UTF-16LE", @binary="cscript //E:jscript //Nologo //U">
irb(main):003:0> ExecJS.runtime
You still have JScript
as engine selected. Make sure Node is in your path, so it can be detected.
from haml_coffee_assets.
Node is in your path
How to realize it? I'am newbie =)
from haml_coffee_assets.
%PATH%
is a list of directories where Windows will search for executables, so you have to add the location where the node
command can be found.
from haml_coffee_assets.
But there already is a reference to nodeJS: Files \ Git \ cmd; C: \ Users \ roma \ AppData \ Roaming \ npm; C: \ Program Files \ nodejs \
from haml_coffee_assets.
How do you start your server? From the command line or an editor?
from haml_coffee_assets.
From the command line
from haml_coffee_assets.
Make sure the path is right in Ruby and the node runtime is available:
$ pry
[1] pry(main)> ENV['PATH']
=> "/usr/local/bin:/usr/local/share/npm/bin:/Users/michi/node_modules/.bin:/Users/michi/.bin:/Users/michi/.rvm/gems/ruby-1.9.3-p125/bin:/Users/michi/.rvm/gems/ruby-1.9.3-p125@global/bin:/Users/michi/.rvm/rubies/ruby-1.9.3-p125/bin:/Users/michi/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/share/npm/bin"
[2] pry(main)> require 'execjs'
=> true
[3] pry(main)> ExecJS::Runtimes::Node.available?
=> true
According to ExecJS, JScript is the least desired runtime, guess they have good reason to do so.
If you still have problem getting the node runner recognized, have a look at the relevant lines for locating it in ExecJS.
from haml_coffee_assets.
Have you found a solution?
from haml_coffee_assets.
ExecJS::Runtimes::Node.available? return true
but libv8 gem is not established
from haml_coffee_assets.
You're mixing the runtimes. libv8
is a dependency for the Ruby racer, but when you've NodeJS as runtime, you don't need the Ruby racer, so you can uncomment gem "therubyracer"
in your Gemfile
.
from haml_coffee_assets.
uncomment gem "therubyracer"
? it's uncommented
from haml_coffee_assets.
Have you run bundle
after uncommenting? You can see which Gem has it as dependency within Gemfile.lock
.
from haml_coffee_assets.
Have you run bundle after uncommenting?
yes and Gemfile.lock
from haml_coffee_assets.
It still tries to install the Ruby Racer. Try bundle update
.
from haml_coffee_assets.
same shit
from haml_coffee_assets.
Sorry, you should comment it, since it's not needed.
from haml_coffee_assets.
lol =)
from haml_coffee_assets.
There should be no .hamlc
extension anymore after it has been compiled. How did you name your template?
from haml_coffee_assets.
Template why it is transformed into index.hamlc.js
How did you name your template?
index.jst.hamlc
from haml_coffee_assets.
You may have a unicorn in between your browser and the server, that dislocates the template with a space-time bending. It's just a guess, since I don't have more information.
from haml_coffee_assets.
Since I don't have the patience anymore to ask thousand of questions to get all the needed information that let me help you, I suggest that you put the project on GitHub and send me the link, so I can have a quick look.
from haml_coffee_assets.
ok, i wrote you private message
from haml_coffee_assets.
Thanks, I cloned your repo and found the problem: You had the templates index.jst.ejs
and index.jst.hamlc
in the same folder. This is not possible, since both files will be compiled to index.js
. I renamed index.jst.hamlc
simply to index2.jst.hamlc
and the template was compiled fine and server through the asset pipeline.
from haml_coffee_assets.
Related Issues (20)
- Incompatibility with Rails 4.2.5.1 from a change to find_templates HOT 15
- WARNING: Author has died; repository not maintained HOT 1
- fix for sprockets ~> 3.5 HOT 1
- CVE fixing Rails 3.2.22.2 breaks compability with haml_coffee_assets: wrong number of arguments (5 for 4) HOT 1
- Templates not being found HOT 24
- Status of Repo HOT 1
- Asking to precompile jquery.self.js HOT 3
- Syntax errors doesn't highlight the template line HOT 2
- Deprecation warning: `register_engine` for Sprockets HOT 2
- Version 1.17 causes serious breakage HOT 9
- small deprecation warning, rails 5 HOT 1
- Hyphens in template names are being replaced with underscores HOT 2
- find_asset doesn't work when config.assets.compile = false HOT 2
- DEPRECATION WARNING: Single arity template handlers are deprecated HOT 4
- Anybody still maintaining this gem? HOT 5
- Rails 6.0 - undefined method 'append=' for nil:NilClass HOT 1
- Jasmine failures with ruby 2.5 HOT 5
- Mimetype .hamlc is not getting registered HOT 6
- Can you add Rails 7 support? HOT 2
- .hamlc is unexpectedly processed by JstProcessor HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haml_coffee_assets.