Object Doesn't Support This Property or Method Rails Windows 64Bit

Object doesn't support this property or method Rails Windows 64bit

Contrary to popular belief, Rails is NOT cross platform compatible as they claim. If it was it would work on windows, out of the box. Like you I have tried every available option.

This was solved using Ruby 2.1.5p273/Rails 4.2.0

I changed execjs to use UTF-8 with jscript, no effect. This was done by editing C:\RailsInstaller\Ruby2.1.0\lib\ruby\gems\2.1.0\gems\execjs-2.2.2\lib\execjs\runtimes.rb changing the JScript = block to the following.

JScript = ExternalRuntime.new(
name: "JScript",
command: "cscript //E:jscript //Nologo",
runner_path: ExecJS.root + "/support/jscript_runner.js",
encoding: 'UTF-8' # CScript with //U returns UTF-16LE
)

I also tried installing therubyracer which leads to problems with the libv8 dependency not compiling. I added my python 2.7 install to the windows system path, and installed libv8. Then it said libv8 was installed but when I tried to install therubyracer it said libv8 couldn't be found. I uninstalled libv8 and tried again and it said libv8 couldn't be compiled. That was enough for me to determine that therubyracer was not going to work on windows, so I commented it out of my Gemfile, leaving python 2.7 on my windows system path.

I updated coffee-script-source, by adding the following to my Gemfile

gem 'coffee-script-source', '1.9.0'

After adding coffee-script-source to my Gemfile I ran gem update coffee-script-source , this also didn't solve the problem.

I then installed node.js, this worked for 5 minutes until I generated a new controller, and it was broken again.

Note: After installing node.js you need to open a new command prompt to get the updates to your system path that are setup when node.js installs.

Finally what fixed this problem was to open up the app\assets\javascripts\application.js file and remove the last line which says

//= require_tree .

Lastly run the following command to make sure coffee-script is properly installed in Node.js

npm install -g coffee-script

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

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.

ExecJS::ProgramError in Welcome#index TypeError: Object doesn't support this property or method

In your /app/views/layouts/application.html.erb line 5 and 6, change the first parameter application to default.

ExecJs throwing error for rails_admin on Windows

Try this. In your Gemfile, put

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

then run

bundle update coffee-script-source

I've read 1.9.0 has issues on Windows, and have used this workaround in the past, but the issue resurfaced in a newer project with Rails Admin today, leading me to your post. Of course it works on Ubuntu and Mac OSX. Here's another post where this worked for someone else.

javascript_include_tag throws unsupported method

I recently found another solution for this problem. gem 'coffee-script-source' in 1.9.0 has some issues with Rails on Windows. I reverted to the previous version using gem 'coffee-script-source', '1.8.0' in the Gemfile, this will resolve your problem.

Another way of solving this exception is installing Node.js onto your machine and the error should go away after installing & restarting rails server. Make sure that you add Node.js into your PATH before restarting the terminal(s) and rerun the server.

Rails ExecJS::ProgramError in Pages#home?

In your /app/views/layouts/application.html.erb
lines 5 and 6, change the first parameter from application to default.

I met the same problem, too
for my situation, I don't know why, but it only happens on Windows.
The parameter application works on the web server.



Related Topics



Leave a reply



Submit