Rails coffeescript : TypeError: Object doesn't support this property or method

后端 未结 2 1804
误落风尘
误落风尘 2020-12-20 08:39

I have the following rails configuration:

Windows 7
Rails 4.1.1
Ruby 2.0.0p481
Gem: coffee-rails 4.0.1
Gem: coffee-script 2.3.0
Gem: coffee-script-source 1.9         


        
相关标签:
2条回答
  • 2020-12-20 09:11

    According tho this, CoffeeScript doesn't play well with Windows. You may want to try downgrading the version of CoffeeScript or completely removing it from your Gemfile.

    Then just rename the .coffee file to a plain .js and rock regular javascript in your Rails app.

    0 讨论(0)
  • 2020-12-20 09:11

    I think renaming extension is not good solution. Try following:

    Add to Gemfile

    gem 'coffee-script-source', '1.8.0'
    

    then, run

    bundle update coffee-script-source
    

    and restart the server (if needed)

    0 讨论(0)
提交回复
热议问题