env: bash\r: No such file or directory
The error message suggests that the script you're invoking has embedded \r
characters, which in turn suggests that it has Windows-style \r\n
line endings instead of the \n
-only line endings bash
expects.
As a quick fix, you can remove the \r
chars. as follows:
sed $'s/\r$//' ./install.sh > ./install.Unix.sh
Note: The $'...'
string is an ANSI-C quoted string supported in bash
, ksh
, and zsh
. It is used to ensure that the \r
expands to an actual CR character before sed
sees the script, because not all sed
implementations themselves support \r
as an escape sequence.
and then run
./install.Unix.sh --clang-completer
However, the larger question is why you've ended up with \r\n
-style files - most likely, other files are affected, too.
Perhaps you're running Git on Windows, where a typical configuration is to convert Unix-style \n
-only line breaks to Windows-style \r\n
line breaks on checking files out and re-converting to \n
-only line breaks on committing.
While this makes sense for development on Windows, it gets in the way of installation scenarios like these.
To make Git check out files with Unix-style file endings on Windows - at least temporarily - use:
git config --global core.autocrlf false
Then run your installation commands involving git clone
again.
To restore Git's behavior later, run git config --global core.autocrlf true
.
docker run image : /usr/bin/env: ruby.exe : No such file or directory
Try this:
CMD ruby bin/rails server
It seems that /usr/bin/env is not able to find Ruby. But as you use the official ruby base image, the ruby
command is available.
Related Topics
Using Activerecord Interface for Models Backed by External API in Ruby on Rails
Rails Activerecord Query Date Range
How to Escape a Single Quote in Ruby
What Graphing Packages/Apis Exist for Ruby
C1 or C2 Coverage Tool for Ruby
How to Detect the End of a Method Chain in Ruby
How to Connect to Postgresql Database After Upgrading to Yosemite 10.10
Setting Up Env, Osx Rbenv and Bundle Battle
How to Find a Memory Leak on Heroku
Dynamic CSS in Rails Asset Pipeline, Compile on Fly
Vagrant Install Plugin from Github
How to Read a File's Modification Date with Ruby
Ruby W/ Sinatra: What Is the Equivalent of a .Js.Erb from Rails
Ruby, Run Linux Commands One by One, by Ssh and Log Everything