I just downloaded ImageMagick but am not sure if it's working. I typed in 'which convert' into my terminal and nothing happened. I also tried typing in 'convert logo: logo.gif' then 'identify logo.gif' and lastly 'display logo.gif' and nothing seemed to happen (these three commands were specified on Windows).
Then I tried following this video: http://www.youtube.com/watch?v=gEWAVlNCKhg
However, it still didn't work and on the last step of the video. I got the following error: ERROR: While executing gem ... (OptionParser::InvalidOption) invalid option: ----with-opt-include=C:/ImageMagick/SourceCode
Can anyone advise on how to correctly install imagemagick on windows or what these errors mean?
That video has a bunch of unnecessary stuff if all you want to do is get ImageMagick working as a standalone product on Windows. All you need to do is:
Download latest Windows binary from imagemagick.org. Right now, that file is located here.
Run the installer (leave all default values the way they are)
Open a command prompt (Start --> Run --> cmd.exe)
Navigate to the ImageMagick folder in the command prompt window. For the default install path, this is done as follows :
Change to the root directory of the C: drive (type cd\ followed by the enter key)
Change to the ImageMagick folder (type cd "Program Files\ImageMagick-6.8.6-Q16" followed by the enter key)
Test that it's working with the convert command: convert images\logo.jpg logo.gif
Look at the directory listing and check the for a logo.gif file with the current time/datestamp (dir logo.gif, followed by enter key).
Note: when you run the convert command, there will not be any output to the command prompt unless you turn on the verbose flag e.g. (convert -verbose images\logo.jpg logo.gif)
I noticed that in my installation that there was not a 'display.exe', but there was an 'imdisplay.exe". I tried using imdisplay in a folder that had images, and it did not how a window. I double clicked imdisplay.exe in the installation folder, and windows came up, including all of the ones I tried to open on the command line. When I closed all of those windows and tried the command line again, it worked.
I am not sure where you are getting 'which convert' (I did not watch the video). I can see all of the exe files that are available in the installation folder. convert.exe is one of them, so in a regular cmd window (I do not know anything about Powershell GitShell), you can just type:
convert logo.png logo.jpg
or something like that.
Related
I've been trying for a few hours now solve this problem and I looked everywhere for a solution and I did not find one. I'm trying to run a spec test for my project and I have the following error coming up:
RuntimeError:
Ghostscript not found in your system environment (linux-gnu).
Install it and set the variable RGhost::Config::GS[:path] with the executable.
Example: RGhost::Config::GS[:path]='/path/to/my/gs' #unix-style
RGhost::Config::GS[:path]="C:\\gs\\bin\\gswin32c.exe" #windows-style
And I do try to put RGhost::Config::GS[:path]='/usr/local/bin/gs' and it returns:
bash: RGhost::Config::GS[:path]=/usr/local/bin/gs: No such file or directory
but ghostscript is installed, I did everything (make, sudo make install, etc etc) and when I run gs -v it returns:
GPL Ghostscript 9.26 (2018-11-20)
Copyright (C) 2018 Artifex Software, Inc. All rights reserved.
When I use the user interface and search for "gs" in the "Files" application, it is found in /home/marcelle/projects/ghostscript-9.26/bin/gs and I also tried:
RGhost::Config::GS[:path]='/home/marcelle/projects/ghostscript-9.26/bin/gs'
and it returns the same error:
bash: RGhost::Config::GS[:path]=/home/marcelle/projects/ghostscript-9.26/bin/gs: No such file or directory
I also tried to delete ghostscript from my notebook with autoremove and purge and installed it again using what I mentioned before (./configure, make, sudo make install), restarted the notebook, the terminal and nothing.
PS: I'm using Ubuntu 20.04.
I managed to figure out a solution. Looking for the code for the Rghost, what I saw in its spec is that the path expected was different than the path the ghostscript really is.
When I run whereis or which on my terminal, it returns:
which gs
/usr/local/bin/gs
So I was trying to point to this path. But seeing the spec test for Rghost which I found on github for Rghost, we can see that it expects /usr/bin/gs:
it 'should detect linux env properly' do
RbConfig::CONFIG.should_receive(:[]).twice.with('host_os').and_return('linux')
File.should_receive(:exists?).with('/usr/bin/gs').and_return(true)
RGhost::Config.config_platform
RGhost::Config::GS[:path].should == '/usr/bin/gs'
end
So it expects /usr/bin and not /usr/local/bin.
Then I just copied to that path and the spec ran with no problems anymore:
sudo cp /usr/local/bin/gs /usr/bin
I've no experience with Ruby at all, but I also got this error when using asciidoctor, which uses rghost for the PDF generation.
The command RGhost::Config::GS[:path]='/path/to/my/gs' mentioned in the error is not a shell command, which is why bash couldn't handle it. However, to me it wasn't immediately clear what to do with this command either. I expected an easy way to set this variable somewhere, but couldn't find it.
What worked for me was searching the rghost.rb file, which is where this variable is set and can be changed. In Windows, it was located in C:\Ruby30-x64\lib\ruby\gems\3.0.0\gems\rghost-0.9.7\lib\rghost.rb.
In this file, I added the following line, which solved the problem:
RGhost::Config::GS[:path]="C:\\Program Files\\gs\\gs9.55.0\\bin\\gswin64c.exe"
NB: the mentioned paths can be different for everyone, so make sure to use that paths that are valid for your system.
I am facing a problem generating a collection file of the positive images to train the Haar Cascade in OpenCV to detect a car. On every tutorial I found on the internet, it is the same command, however i am unable to execute it.
I am using Command Prompt and Windows Power Shell to execute this command. find ./positive_images/ -iname '.*pgm' > positives.txt the screenshot of the output I am running this command from root of my directory. The positive images are stored in positive_images folder.
OUTPUT:
File not found - '*pgm'
However, the positive_images directory contains 550 files with .pgm extension.
Error File not found - '*pgm'
I am using Command Prompt and Windows Power Shell to execute this command:
find ./positive_images/ -iname '.*pgm' > positives.txt
The above command is using the syntax of a Unix version of find, but you are running it under Windows. PowerShell does not have a built in find command so you are running C:\Windows\System32\find.exe.
Notes:
Unix find is used to search for files.
Windows find is used to search for string in files.
As you are running on Windows you need to use dir instead of find:
dir /b /s positive_images\*.pgm > positives.txt
Further Reading
An A-Z Index of the Windows CMD command line - An excellent reference for all things Windows cmd line related.
dir - Display a list of files and subfolders.
find - Search for a text string in a file & display all the lines where it is found.
I am developing web applications using Ruby on Rails and Sublime Text 3 on OS X 10.8.4. I recently installed the package RubyTest. The tests only work when Sublime is launched using the command
subl
in terminal. Otherwise I get the error message:
/bin/sh: rspec: command not found
I think that's meant to be the case; that's implied in RubyTest's readme file on github.
However I'd like to retain the ability to launch from the dock. Is there a way I can do this?
Unfortunately, OSX applications do not pick up on your $PATH variable set in Terminal. To change the internal PATH settings in Mountain Lion (this method hasn't been tested with previous versions, although it should work), you'll need to edit /etc/launchd.conf:
Make sure you have admin privileges.
Open Terminal or your favorite substitute and see if there's anything in the file /etc/launchd.conf:
cat /etc/launchd.conf
If you get an error like
cat: /etc/launchd.con: No such file or directory
then continue with the next step. If the cat command does display some content, copy it to the clipboard.
Create a new text file with the following content, modified to fit your needs:
setenv PATH /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/Users/YourUserName/bin:/path/to/gems/bin
If the cat command displayed some content in the previous step, paste it into the new file before the setenv PATH command. If it already contains a setenv PATH command, just modify it to add the directories you need, such as /path/to/gems/bin
Save the new file in your home directory (/Users/YourUserName) as launchd.conf.
Go back to Terminal and enter:
sudo mv ~/launchd.conf /etc
to use admin power to move the new file to /etc, replacing anything that was there before. Depending on your previous usage of the sudo command, you may get a short "be careful doing what you're doing" message, but either way you'll need to enter your password. /etc is not directly accessible through the Save dialog unless you're a real power user and know how to get around OSX's file system restrictions.
Reboot your computer
And you should be all set. If you're interested, launchd and launchctl use the csh/tcsh syntax, so you can't use the bash/zsh export PATH=/usr/local/bin:... format.
I'm using ubuntu and I call gedit by using this command:'sudo gedit filename.java'. I'm newbie in ubuntu so now I can not located that file. Ah I'm using windows XP and ubuntu and I have three disk C,D and E in windows XP the fourth disk for ubuntu is not display in windows XP. Can anyone show me where I can find my file? Thank you very much!
Try looking up the command "find". It will locate files.
The next time you need to find a file and you don't know where it is, just use the locate program included with Ubuntu. Sure, your file most likely won't show up immediately in the slocate database, but it's a really good searcher.
Also, the command line and the run prompt assume that the starting point, that is, the current working directory is always "~" unless you've set it differently. That means that all files and paths are relative to your home folder: /home/username for a user and /root for the root user.
Finally, you do not need to use the sudo command for writing code in your own home directory, and thus you can just stick with gedit filename.java. However, if you ever do need to use a graphical application with root/superuser privileges, use gksu for GTK apps and kdesu for KDE apps. sudo is for when you are running an program or need elevated privileges in a terminal.
Type "man find" into the terminal to get a description of how to use the command. But first place I'd look is the home folder. Open up the terminal and type "~" without quotes.
Open a terminal again ( from where you initially typed sudo ) and type ls -l you have to find it there.
I've just downloaded shoes but can't get them out the box.
double clicked on shoes2.run in ubuntu intrepid and gedit opened with the following message:
Could not open the file /home/mark/Marks files/2…ng/Programming/shoes2.run using the Unicode (UTF-8) character coding.
Please check that you are not trying to open a binary file.
Select a different character coding from the menu and try again.
It offered a dropdown with 2 options and a retry button:
Current locale (UTF-8)
Western (ISO-8859-15)
Neither of them are recognized.
How do i get it running?
m-
I had this same problem. try sudo chmoding the file :
sudo chmod 777 shoes2.run
then try running it as a script
./shoes2.run
that should work.
I am still trying to get shoes2 in my path so I can run it easily like the previous version (which I got through apt-get) right now I have to run it as a script each time I use it.
Good Luck!