Error adding vagrant box in PHPStorm 7, ruby.exe error - ruby

My PHPStorm 7 installation is throwing this error whenever I try to add a box. Am I missing something?
I pointed to the vagrant.bat in installation directory as told here
Am I supposed to install ruby too? Didn't say something like that in vagrant's site though.

The path to the .bat file you are using (...\embedded\gems\...) suggests that it is ruby related .. and may require ruby for proper executing (the error message you see confirms such suggestion).
Instead, choose vagrant executable from C:\Program Files (x86)\HashiCorp\Vagrant\bin\ folder.
If .bat file is absent -- choose .exe one instead.

Related

Windows Script Host Error: Invalid character - Code:800A03F6 - Source: Microsoft JScript compilation error

I'm having an issue with Powershell and CMD. When I try to execute Angular CLI commands in CMD like ng --version or ng new projectName, I get this error;
Windows Script Host Error: Invalid character
Code: 800A03F6
Source: Microsoft JScript compilation error
Update:
On Windows .js files are associated to Windows Scripting Host by default, so the script will not be run with Node.
Open a file explorer and find a JavaScript file, open the JavaScript file's properties and then "open with", select the Node.js program file to open that kind of files.
The error should stop after doing this.
This is how I solved it: (on windows 10)
Go to C:\Users\<your_username>\AppData\Roaming\npm\node_modules\#angular\cli\bin
Check for ng.js
Right click on ng.js file and click on "properties" option
You need to open it with node.exe so click on "Change" button go to node js installed directory and
(example: C:\Program Files\nodejs\node.exe)
Select node.exe
Click on OK
It should change the color of ng.js like below:
Now try ng -v and other ng commands
Installing this exact Angular version:
npm -g install #angular/cli#10.3.1
instead of the latest version:
npm -g install #angular/cli
fixed the above error.
I ran into this exact issue after updating to Angular CLI 13. Tried tons of different suggestions from other threads. What is described in the solutions here is essentially what worked for me, but I just want to point out a possible alternative method to applying the fix that doesn't associate all JS files with node.js.
Trying to execute a script from package.json on Windows throws a JScript error
In your windows system environment variables is one variable called PATHEXT. If the value contains .JS;, remove it. Then restart your CMD windows.
make sure you have proper path variable configured as shown below
Go to your system variable settings
path variable snapshot
make sure you have all these mentioned as part of path
C:\Users<userfolder>\AppData\Roaming\npm\node_modules#angular\cli
C:\Users<userfolder>\AppData\Roaming\npm
C:\Program Files\nodejs
make sure you have all these mentioned as part of path C:\Users\AppData\Roaming\npm\node_modules#angular\cli C:\Users\AppData\Roaming\npm C:\Program Files\nodejs
in my case, before npm install -g #angular/cli, the path of my system variable was:
C:\Users\AppData\Roaming\npm\node_modules#angular\cli\bin
I remove \bin and work!!!!!
Remember to fix this for the correct User
Associating .JS files to node.exe is the way to solve this.
BUT after struggling with the same issue, I wanted to add that the file association needs to be done with the same USER that you are working with the Terminal/Shell.
So if you use the Terminal as a Admin, you must login with your Admin Account just to fix the file association.
Cheers

Installing YAML for PHP in IIS

I am trying to install the YAML 1.2 extension to PHP 5.6 under IIS 10 (Windows 10). I am using http://pecl.php.net/package/yaml/1.2.0/windows to download the files.
I have downloaded the PHP 5.6 non-thread-safe DLL (x86 to match my version of PHP), copied php_yaml.dll to my extension directory, copied yaml.dll to C:\Windows\System32 (which is reported as one of the paths in phpinfo()) and added extension=php_yaml.dll to my php.ini. I've verified with phpinfo() that the correct php.ini file is being loaded, and commenting out other extensions removes them from the output of phpinfo().
However, YAML doesn't appear in the output of phpinfo() and the functions are not loaded. Running php-cgi.exe -v from the command line gives a warning:
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\PHP\php_5_06_14\ext\php_yaml.dll' - The specified module could not be found.
in Unknown on line 0
The file exists at the location specified and the permissions appear to be correct. What else can I do to get it working?
As far as I can tell, the use of PECL as package manager is being in dropping.
Having to install extensions in a server makes things more complicated and it depends on the environment, permissions, etc.
I'm sure someone could help you solve that (I haven't work on windows in years, so I can't)
But, instead I suggest you another solution. Maybe you can opt for it, maybe you have to stick with the extension, but, in case you can actually look for other option, I suggest you to use another library.
https://github.com/symfony/yaml
And, you could use Composer to install your libraries, I suggest you take a look at it.
Again, it may be for you or not, but I think this would be a lot easier.
I hope that helps.
I put the path to my extension directory in the path environment variable. That fixed the issue for me.

Leiningen install for Windows error

I'm very unskilled when it comes to the command prompt, so I tried to download Lein through the Windows installer that's on the website. It almost installs, but then I get this error at the very end of the install:
"Failed to update file: C:\Users\.lein\profiles.clj.
Ensure that :java-cmd is set to: 'C:\Program Files\Java\jdk1.7.0_25\bin\java.exe' in your
:user profile.
Result: Ran; Code: 1".
What could cause this to happen? How can I fix it?
I guess you only have the JRE installed instead of the JDK.
Open a command and enter "javac". Most probably the OS cannot find it. If so, download one here:
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
Afterwards add the JDK_INSTALL\bin location to your windows path. This should fix it.

Can't run ruby in aptana studio 3.4.2

As the problem described in
Can't run a ruby hello world application in Aptana.
The answer says it is fixed in 3.0.4. But I still got the same error c:\ruby\bin\rubyw.EXE: Permission denied -- C:/ruby/bin (LoadError).
Is there any solution to this problem?
I think the main reason of this problem is cause of your computer security level.
So you need to decrease your security level
OR
①Change your Ruby installed file (eg. Ruby193 folder) to D Drive or other operating system not installed place.
②and copy your URL until bin folder of Ruby change place .
eg.D:\Ruby193\bin
③
and change and paste the URL that you copied to your computer Path of system variables which having at environment variable setting .

Error with Compass polling on windows 7

I am attempting to work locally on a PHP application which I cloned from the Git repository my partner and I use.
He uses a Mac, and until now I have been working on the app in a virtual Ubuntu Linux environment. Both environments have been able to use Compass polling with the same file structure and files.
On Windows 7, I run Compass commands from Cygwin, and this is the command I use to have Compass poll from the root directory of the app (C:/wamp/www/application):
compass watch --trace src/Application/ApplicationBundle/Resources/compass/
When I then make a change to a .scss file, I receive the following error:
ArgumentError on line 716 of /usr/lib/ruby/1.8/pathname.rb: different prefix: "/
/cygdrivecwampwwwlimelightsrclimelightlimelightbundleresourcescompasssrcpartials
_object.scss" and "/cygdrive/c/wamp/www/limelight/src/limelight/limelightbundle/
resources/compass/src"
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/path.rb:81:in 'split_path'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/path.rb:69:in 'run_callback'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/path.rb:55:in 'callback_action'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/path.rb:35:in 'update'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/state/directory.rb:39:in 'modified'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/state/directory.rb:37:in 'each'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/state/directory.rb:37:in 'modified'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/state/directory.rb:18:in 'refresh'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/backends/polling.rb:17:in 'run'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/backends/polling.rb:17:in 'each'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/backends/polling.rb:17:in 'run'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/backends/polling.rb:15:in 'loop'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/backends/polling.rb:15:in 'run'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/monitor.rb:26:in 'run'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm.rb:20:in 'monitor'
/usr/lib/ruby/gems/1.8/gems/compass-0.11.1/lib/compass/commands/watch_project.rb:86:in 'perform'
/usr/lib/ruby/gems/1.8/gems/compass-0.11.1/lib/compass/commands/base.rb:18:in 'execute'
/usr/lib/ruby/gems/1.8/gems/compass-0.11.1/lib/compass/commands/project_base.rb:19:in 'execute'
/usr/lib/ruby/gems/1.8/gems/compass-0.11.1/lib/compass/exec/sub_command_ui.rb:43:in 'perform!'
/usr/lib/ruby/gems/1.8/gems/compass-0.11.1/lib/compass/exec/sub_command_ui.rb:15:in 'run!'
/usr/lib/ruby/gems/1.8/gems/compass-0.11.1/bin/compass:25
/usr/lib/ruby/gems/1.8/gems/compass-0.11.1/bin/compass:39:in 'call'
/usr/lib/ruby/gems/1.8/gems/compass-0.11.1/bin/compass:39
/usr/bin/compass:19:in 'load'
/usr/bin/compass:19
All I've been able to find through searching is that it may have something to do with the fact that Windows capitalizes its drive names, although the lack of slashes in the returned path makes me think the problem may be elsewhere.
Does anyone know why I might receive this error in Windows, but not other platforms?
NOTE: I have found a work-around involving installing ruby (and compass) through Windows' command prompt rather than Cygwin, and that should work fine for now. Still, if anyone has ideas, I'm still curious as to what the problem could be.
According to this commit, this is a problem caused by a compass dependency called FSSM. It is used to monitor file changes in compass. A workaround is described in this comment.
It seems that FSSM detects that ruby is running inside a Windows box, and treats paths in the Windows' way (C:\blabla). Commenting out the line 26 of the file <fssm_gem_path>/lib/fssm/pathname.rb makes compass watch work as expected. You can also add
unless path[0, 1] == File::SEPARATOR
to the end of line 26 to make it work.
I thought I'd just provide a little more info to help people find the pathname.rb file.
On the cygwin prompt type:
gem env
This (unsurprisingly) brings up a load of info about your Ruby Gems installtion. Look for the line which specifies the INSTALLATION DIRECTORY. Mine was:
/usr/lib/ruby/gems/1.8
Now in Windows Explorer navigate to this location but substitute "usr" for your cygwin installation directory. Therefore the above path becomes:
C:\cygwin\lib\ruby\gems\1.8
Once in this location drill down until you come across the fssm gem directory.
Within this [fssm] directory go into:
/lib/fssm/
...and there you should find the pathname.rb file.
Edit it as above and all is well. I hope this helps.
See here for a possible fix:
http://rails.webintellix.com/2010/05/27/error-in-ruby-relative_path_from-call-on-windows/
I was running into this same error with a slightly different setup. My project folder was on a network drive (ruby and sass/compass installed locally), and every time I made a change to a .scss file compass watch would crash with similar errors to the OP. I solved the issue by mapping my network drive instead of accessing it directly via the network (right clicked on My Computer and choose map network drive so I could access my remote drive at A:).
Now, instead of doing 'compass watch //SERVERNAME/My_Project' (I'm using Git Bash), I do 'compass watch a/My_Project' and compass stopped crashing.
Hope that helps someone else.
Using Cygwin, re install a compass dev release (such as 0.13+). Works for me with Compass 0.13.alpha.4 (Markab)
To do so:
gem uninstall compass
gem install compass --pre --no-rdoc --no-ri

Resources