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. -- Posted via http://www.ruby-forum.com/.
On 1/24/06, Matteo Dall''Osso <osso.m@inwind.it> wrote:> > 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. > > --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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060124/068f2cbb/attachment.html
> 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 > > DaveYes, 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! -- Posted via http://www.ruby-forum.com/.
Matteo Dall''Osso wrote:> But now I''ve another problem: > > matteod@bones:~/work/rails-code/depot8$ script/serverThat 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
On Jan 24, 2006, at 6:08 PM, Ben Munat wrote:> 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 ..."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
Dudley Flanders wrote:> > On Jan 24, 2006, at 6:08 PM, Ben Munat wrote: > >> 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 ..." > > > 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. >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