Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2736  / 1 Year ago, thu, january 26, 2023, 11:29:02

I am using Ubuntu 12.04 64 bits. I've recently installed the ruby1.9.1 package and the wx-ruby gem using :



sudo gem install wxruby-ruby19


in order to install the ruby1.9 compatible version.



So I wrote a ruby script called fenetre_wx.rb (which has already execution right)



#!/usr/bin/env ruby
require "wx"
include Wx

class FenetrePrincipale < App
def on_init
Frame.new(nil, -1, "My app in Ruby with WxRuby", Point.new(-1,-1), Size.new(640,480)).show
end
end

FenetrePrincipale.new.main_loop


No problem when I call



 ruby fenetre_wx.rb


But when I do :



 ./fenetre_wx.rb


I get the following error :




bash: ./fenetre_wx.rb: Aucun fichier ou dossier de ce type




Which can be translated by :




"No file nor directory of this type" :




I've got the French version, but maybe my translation is wrong, so I left the original text.



Does someone know what's wrong ? Thanks in advance.


More From » bash

 Answers
5

Please make sure that line endings are unix style in your source file and the source doesn't start with the byte order mark. Byte order mark is a three hex number sequence ( 0xef 0xbb 0xbf) which are invisible through any editor. refer to this StackOverflow question for a solution to byte order mark problem. and use dos2unix for line endings conversion.


[#34953] Saturday, January 28, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
landarre

Total Points: 254
Total Questions: 96
Total Answers: 109

Location: Burundi
Member since Sun, Apr 16, 2023
1 Year ago
landarre questions
;