Unable to run Haml or Sass on Terminal. Using OSX Lion. RVM, GCC, Ruby, Rails, Haml, Sass installed - osx-lion

I'm very new at this so I'll give as many details as possible:
Using Mac OSX 10.7.4
Installed today:
TextMate 1.5.11
RVM 1.15.5 by Wayne Seguin
GCC 10.7
Ruby 1.9.3
Rails 3.2.8
Haml 3.1.7
Sass 3.2.1
Haml instructions:
To run Haml from the command line, just use
haml input.haml output.html
When I input the above command, my Terminal responds:
Errno::ENOENT: No such file or directory - input.haml
Use --trace for backtrace.
When I input:
--trace
It returns:
-bash: --trace: command not found
Having similar issue with Sass:
$ sass --watch style.scss:style.css
>>> Sass is watching for changes. Press Ctrl-C to stop.
Errno::ENOENT: No such file or directory - style.scss
Use --trace for backtrace.
Do I need to create the input.haml and output.haml files first and put them in a directory somewhere? If so, can someone give me a very specific path where the folder needs to go?
Similar question for the Sass files -- do they need to be in a particular folder for the Terminal to locate them?
And.. unsure why --trace is not working...
Can someone advise me on how to troubleshoot this? I am only familiar with HTML/CSS, and have been asked to learn Haml/Sass by my team.

input.haml should exist and should be a haml file. output.html is where the output will be stored (and will be overwritten if it exists)
Those files can be anywhere you want, but if they aren't in the current directory you'll need to adjust the path accordingly.
Similarly for sass style.scss must exist and the resulting CSS will be output to style.css

You're not using --trace command properly. In UNIX command line, programs that run in command line (also called cli as in command line interface) use options known as flags that begin with - or --. So without ever having used HAML code, I see that this is a flag used like this:
➜ ~ uname -a
Darwin Angel.local 12.0.0 Darwin Kernel Version 12.0.0: Sun Jun 24 23:00:16 PDT 2012; root:xnu-2050.7.9~1/RELEASE_X86_64 x86_64
➜ ~ cat > test.haml
#content
.left.column
%h2 Welcome to our site!
%p= print_information
.right.column
= render :partial => "sidebar"
^C
➜ ~ haml test.haml
Exception on line 4: undefined local variable or method `print_information' for #<Object:0x007f9844896cd0>
Use --trace for backtrace.
Use --trace for backtrace.
➜ ~ haml test.haml --trace
test.haml:4:in `block in render': undefined local variable or method `print_information' for #<Object:0x007fd83b9f8650> (NameError)
from /Users/atma/.rvm/gems/ruby-1.9.3-p194/gems/haml-3.1.7/lib/haml/engine.rb:191:in `eval'
from /Users/atma/.rvm/gems/ruby-1.9.3-p194/gems/haml-3.1.7/lib/haml/engine.rb:191:in `render'
from /Users/atma/.rvm/gems/ruby-1.9.3-p194/gems/haml-3.1.7/lib/haml/exec.rb:281:in `process_result'
from /Users/atma/.rvm/gems/ruby-1.9.3-p194/gems/haml-3.1.7/lib/haml/exec.rb:41:in `parse'
from /Users/atma/.rvm/gems/ruby-1.9.3-p194/gems/haml-3.1.7/lib/haml/exec.rb:21:in `parse!'
from /Users/atma/.rvm/gems/ruby-1.9.3-p194/gems/haml-3.1.7/bin/haml:9:in `<top (required)>'
from /Users/atma/.rvm/gems/ruby-1.9.3-p194/bin/haml:19:in `load'
from /Users/atma/.rvm/gems/ruby-1.9.3-p194/bin/haml:19:in `<main>'
from /Users/atma/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/atma/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
➜ ~
Apart from that, I just installed haml gem on MacOSX 10.8 via RVM and works fine. Running ruby filename.haml might come with a helpful message also.

Using Google Chat screenshare, my online co-workers looked at my Terminal activity and then gave me some commands to use so that the file(s) could be found. Next, they had me put a simple line of "Hello World" in my input.haml document for testing purposes.
Today haml can now find the file(s), and when I gave it the command regarding the input.haml and output.html files, it successfully transferred the data from input to output.
So the problem was my lack of knowledge regarding how to get to the correct directory in Terminal.
Doras-MacBook-Pro:~ whisperland$ cd/Users/whisperland/documents/ haml input.haml
-bash: cd/Users/whisperland/documents/: No such file or directory
Doras-MacBook-Pro:~ whisperland$ cd documents
Doras-MacBook-Pro:documents whisperland$ ls
document.haml output.html
input.haml typography.rtf
Doras-MacBook-Pro:documents whisperland$ haml input.haml
hello world
Doras-MacBook-Pro:documents whisperland$ haml input.haml output.html

Related

LaTeXindent fail in VSCode: Can't locate Log/Log4perl.pm

I'm using LaTeX Workshop on VSCode to build pdf using LaTeX and I'm getting this error in the Output console when I save the .tex file.
Formatting with command latexindent
-c,d:path_to_folder,d:path_to_folder/__latexindent_temp.tex,-y=defaultIndent:
' '
Formatting failed with exit code 2
stderr: Can't locate Log/Log4perl.pm in #INC (you may need to install the Log::Log4perl module) (#INC contains: C:/Program Files/MiKTeX/scripts/latexindent C:/Perl64/site/lib C:/Perl64/lib) at C:/Program Files/MiKTeX/scripts/latexindent/LatexIndent/LogFile.pm line 22.
The problem is only related to the formatting stuff because the build runs successfully generating the pdf as supposed.
What I did:
Opened the CPAN Client of my Windows 10
Run install Log::Log4perl (it installed also other packages like Log::Dispatch::File and
YAML::Tiny)
Rebooted the system
Checked that Log4perl is installed and it is
I also tryied to install Log4perl through VSCode cmd but I'm getting this wierd error:
Running make for E/ET/ETJ/Log-Log4perl-1.53.tar.gz
to undefined at C:/Perl64/site/lib/ExtUtils/Install.pm line 141.
make: *** [pm_to_blib] Error 255
ETJ/Log-Log4perl-1.53.tar.gz
"C:\Program Files (x86)\GnuWin32\bin\make.exe" -- NOT OK
Failed during this command:
ETJ/Log-Log4perl-1.53.tar.gz : make NO
Any suggestions?
I figured it out in the end! To solve the error do:
Download latexindent.exe
Edit Latex-workshop › Latexindent:
Path in the Latex Workshop VSCode extension settings with the
latexindent.exe path

/bin/sh: mpic++ command not found in Eclipse for Parallel Application Developers

I'm trying to use Eclipse for Parallel Application Developers to do some MPI stuff but I can't get the program to compile. Below is the error I'm getting in the console:
Description Resource Path Location Type
/bin/sh: mpic++: command not found prog C/C++ Problem
I use mpic++ from the command line (bash shell) to successfully compile programs. When I run the command using bourne shell I get an error.
/bin/sh mpic++
/usr/local/bin/mpic++: /usr/local/bin/mpic++: cannot execute binary file
When I use sudo I still get the same error. But when I first change to the bourne shell then run the mpic++ command it works.
/bin/sh
sh-3.2$ mpic++
clang: error: no input files
I've been looking at ways to change the shell used by eclipse so I can use the bash shell because I can call mpic++ without any problems. I've also tried launching eclipse with sudo but that didn't work.
I have compiled mpi in eclipse successfully. Please follow the steps:
In terminal type:
$ which mpicxx
/usr/local/bin/mpicxx
You should get the mpicxx binary path as result. I have my mpicxx in /usr/local/bin/ directory.
In eclipse, go to project properties:
Set GCC C Compiler as: /usr/local/bin/mpicxx
Also set GCC C+ Compiler as: /usr/local/bin/mpicxx
Set MacOS X C++ Linker as: /usr/local/bin/mpicxx. Also set All options as -L/usr/local/lib

Bundle with capistrano installed by chef

I'm configuring a vagrant box using chef and then deploying my app using capistrano.
my chef recipe to install bundler is the following:
include_recipe "rbenv"
include_recipe "rbenv::ruby_build"
rbenv_ruby node[:rbenv][:ruby] do
global true
end
rbenv_gem "bundler" do
ruby_version node[:rbenv][:ruby]
end
using the Riot rbenv cookbook
When I try using the bundle with capistrano I figured that the executed bundle is one that was preinstalled on the box, rather than the one installed by chef.
Here's the problem:
$ which bundle
/opt/rbenv/shims/bundle
$ sudo which bundle
/usr/bin/bundle
$ sudo su -
root# which bundle
/opt/rbenv/shims/bundle
Basically it appears that Capistrano runs the commands using the second form, were it uses the /usr/bin/bundle.
I've tried running:
$ sudo bundle
/usr/lib/ruby/vendor_ruby/bundler/rubygems_ext.rb:8:in `require': no such file to load -- rubygems (LoadError)
from /usr/lib/ruby/vendor_ruby/bundler/rubygems_ext.rb:8
from /usr/lib/ruby/vendor_ruby/bundler.rb:11:in `require'
from /usr/lib/ruby/vendor_ruby/bundler.rb:11
from /usr/bin/bundle:4:in `require'
from /usr/bin/bundle:4
and I obtain exactly the same exception I see in Capistrano.
If I manually uninstall bundler then here's what I obtain:
$ bundle
Bundler::GemfileNotFound
$ sudo bundle
sudo: bundle: command not found
$ sudo su -
root# bundle
Bundler::GemfileNotFound
UPDATE
I've figured that the whole ruby version is not available for sudoers:
$ ruby -v
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]
$ sudo ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
even more troubles.
Can you help me ?
thanks.
The problem is not that the rbenv-managed Ruby is not available to sudoers. The problem is that the system Ruby is used by default, unless overridden by something else -- usually .bashrc or a /etc/profile.d/* or such.
Since capistrano doesn't source any of these files, it uses the system Ruby.
You should tell cap to use the rbenv bin paths before the system ones by adding:
set :default_environment, {
'PATH' => "/opt/rbenv/shims:/opt/rbenv/bin:$PATH"
}
to your deploy.rb file.
Update
In Capistrano v3, the :default_environment has been renamed to :default_env.
Apparently tweaking with the default_env is a possibility, but not the preferred way.
as:
set :default_environment, {
'PATH' => "/opt/rbenv/shims:/opt/rbenv/bin:$PATH"
}
is not maintained by capistrano and probably even dangerous.
The preferred way is to look into the program one wants to run for a way to fix this.
In particular my problem: the RVM needs to be initialized upon shell startup, and any RVM installation tool will include your .bashrc with the call to the proper init script at the end of the file. Also at the beginning of .bashrc there's a command that exits the script when it's called on a non interactive shell.
Accidentally Capistrano runs the scripts on a non interactive shell, so when it calls RVM commands they are not initialized, in the non interactive shell.
The solution in my case was to edit the .bashrc file in chef so to call the RVM init script before exiting.

Emacs Wanderlust error: "no such file or directory, gnutls-cli"

I am trying to open gmail with Emacs. M-x wl yields the following error message.
/usr/bin/mail is not an executable. Setting mail-interactive to t.
Initializing...
Loading mail-mime-setup...done
gnus-mime-setup is not found.
emh-setup is not found.
Updating addresses...done
Checking environment...
Auto plugged off at imap.gmail.com:993
byte-code: Searching for program: no such file or directory, gnutls-cli
Any ideas?
It wants you to install a utility called gnutls-cli. If you're on a Debian-derived distribution, apt-get install gnutls-bin which contains this utility and a few others. If you're on something else, please edit your question to include more details.

Error when trying to execute Sass script via Zsh terminal on Mac OS X

I've recently switched over from using the Bash command prompt to Zsh on Mac OSX.
Problem I have using Zsh is that the command I would use to watch Sass files no longer works.
The script file I have is sass.sh and the content is...
#!/bin/sh
sass --style expanded --watch Assets/Styles/Sass:Assets/Styles --debug-info
exit 0
...but every time I run sh sass.sh I get the error...
/Users/<home-directory>/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find sass (>= 0) amongst [bigdecimal-1.1.0, io-console-0.3, json-1.5.4, minitest-2.5.1, rake-0.9.2.2, rdoc-3.9.4] (Gem::LoadError)
from /Users/<home-directory>/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /Users/<home-directory>/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems.rb:1230:in `gem'
from /Users/<home-directory>/.rvm/gems/ruby-1.9.3-p125/bin/sass:18:in `<main>'
from /Users/<home-directory>/.rvm/gems/ruby-1.9.3-p125/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/<home-directory>/.rvm/gems/ruby-1.9.3-p125/bin/ruby_noexec_wrapper:14:in `<main>'
...and I don't know how to resolve this problem.
It looks like it just can't locate the Sass gem, but if I run gem list --local I can see sass (3.2.3, 3.2.1, 3.1.20, 3.1.17, 3.1.15) in the list of gems. BUT I do also get an error again displayed first...
Error loading RubyGems plugin "/Users/<home-directory>/.rvm/gems/ruby-1.9.3-p125/gems/rubygems-bundler-0.2.8/lib/rubygems_plugin.rb": cannot load such file -- rubygems_bundler/rubygems_bundler_installer (LoadError)
I've looked around on Google and SO and found miscellaneous references to similar issues but none that helped me and my specific issue.
Can any one tell me what I need to do to resolve this issue so I can continue to use Zsh and run my Sass script.
Well, seems the answer is very simple. When using Zsh you no longer use the sh command but the zsh command.
So instead of sh sass.sh I just needed to do zsh sass.sh