# A little problem

**URL:** <https://www.ruby-forum.com/t/a-little-problem/96742>\
**Category:** Rails\
**Created:** [January 24, 2006, 6:55pm UTC](https://www.ruby-forum.com/t/a-little-problem/96742 "2006-01-24T18:55:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdallosso](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d9b06d/32.png) [@mdallosso](https://www.ruby-forum.com/u/mdallosso)\
**Post date:** [January 24, 2006, 6:55pm UTC](https://www.ruby-forum.com/t/a-little-problem/96742/1 "2006-01-24T18:55:12Z")

</div>

Hi everyone,  
I’m Matteo, I’m Italian, so sorry for my bad English.  
I’ve just downloaded the “depot” examples, but I’ve an error:

# script/server

bash: script/server: /Users/dave/ruby1.8/bin/ruby: bad interpreter: No  
such file or directory  
matteod@bones:~/work/rails-code/depot8$

What’s wrong? Would you mind suggesting me how to fix this problem?  
I’m under Ubuntu Linux,  
I’ll appreciate any your answer,  
THANKs,  
Matte.

---

<div class="post-metadata">

**Author:** ![mdallosso](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d9b06d/32.png) [@mdallosso](https://www.ruby-forum.com/u/mdallosso)\
**Post date:** [January 24, 2006, 7:18pm UTC](https://www.ruby-forum.com/t/a-little-problem/96742/2 "2006-01-24T19:18:24Z")

</div>

On 1/24/06, Matteo Dall’Osso [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> What’s wrong? Would you mind suggesting me how to fix this problem?  
> I’m under Ubuntu Linux,  
> I’ll appreciate any your answer,  
> THANKs,  
> Matte.
> 
> –

Looks like your environment is not set up correctly. script/server is  
looking for ruby in /Users/dave/ruby1.8/bin. Is it there? Probably not.  
You can try to change that first line in script/serve to:

#!/usr/bin/env ruby

Dave

---

<div class="post-metadata">

**Author:** ![mdallosso](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d9b06d/32.png) [@mdallosso](https://www.ruby-forum.com/u/mdallosso)\
**Post date:** [January 24, 2006, 8:06pm UTC](https://www.ruby-forum.com/t/a-little-problem/96742/3 "2006-01-24T20:06:43Z")

</div>

> Looks like your environment is not set up correctly. script/server is  
> looking for ruby in /Users/dave/ruby1.8/bin. Is it there? Probably not.  
> You can try to change that first line in script/serve to:
> 
> #!/usr/bin/env ruby
> 
> Dave

Yes, you’re right! THANKS !!!  
But now I’ve another problem:

matteod@bones:~/work/rails-code/depot8$ script/server  
bash: script/server: /usr/bin/: bad interpreter: Permission denied  
matteod@bones:~/work/rails-code/depot8$

Both “ruby” and “ruby1.8” have these permissions:

root@bones:/usr/bin# ls -all ruby\*  
lrwxrwxrwx 1 root root 7 2005-11-13 18:13 ruby -\> ruby1.8  
-rwxrwxrwx 1 root root 3464 2005-10-07 18:10 ruby1.8

Many thanks!

MATTE!

---

<div class="post-metadata">

**Author:** ![mdallosso](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d9b06d/32.png) [@mdallosso](https://www.ruby-forum.com/u/mdallosso)\
**Post date:** [January 25, 2006, 1:09am UTC](https://www.ruby-forum.com/t/a-little-problem/96742/4 "2006-01-25T01:09:48Z")

</div>

Matteo Dall’Osso wrote:

> But now I’ve another problem:
> 
> matteod@bones:~/work/rails-code/depot8$ script/server

That command should be “ruby script/server”. You’re invoking the ruby  
interpreter with the argument “script/server”.  
Also, that argument is actually the path to a ruby script, so you have  
to invoke this from the root directory of your  
project (so that there actually is a “script” sub-directory with a  
“server” script inside it).

On the other hand, you’re on linux so maybe the “shebang” line  
(#!/usr/bin/ruby) is enough to get the script to work…  
someone set me straight if that’s the case. In the meantime, try it with  
“ruby …”

b

---

<div class="post-metadata">

**Author:** ![mdallosso](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d9b06d/32.png) [@mdallosso](https://www.ruby-forum.com/u/mdallosso)\
**Post date:** [January 25, 2006, 3:04am UTC](https://www.ruby-forum.com/t/a-little-problem/96742/5 "2006-01-25T03:04:31Z")

</div>

Dudley F. wrote:

> > interpreter with the argument “script/server”. Also, that argument is  
> > shebang line is correct. “#!/usr/bin/env ruby” should work if there’s a  
> > ruby in your $PATH. Having the wrong line endings in a script will  
> > cause some weird “bad interpreter” messages, though, so be careful of  
> > that.

Hm, yeah wrong line endings… have had that problem on linux in other  
programming  
languages. I found that opening with nano does the conversion  
automatically (and then just  
save the file)… SciTE has a menu option for that too.

b

---

<div class="post-metadata">

**Author:** ![mdallosso](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d9b06d/32.png) [@mdallosso](https://www.ruby-forum.com/u/mdallosso)\
**Post date:** [January 25, 2006, 2:43am UTC](https://www.ruby-forum.com/t/a-little-problem/96742/6 "2006-01-25T02:43:23Z")

</div>

On Jan 24, 2006, at 6:08 PM, Ben M. wrote:

> On the other hand, you’re on linux so maybe the “shebang” line (#!/  
> usr/bin/ruby) is enough to get the script to work… someone set me  
> straight if that’s the case. In the meantime, try it with “ruby …”

Yeah, you should be able to run “script/server” directly, assuming  
the shebang line is correct. “#!/usr/bin/env ruby” should work if  
there’s a ruby in your $PATH. Having the wrong line endings in a  
script will cause some weird “bad interpreter” messages, though, so  
be careful of that.

=dudley
