When I want to run my .rb file on Terminal this comes up the whole time:
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- fox (LoadError)
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
Possibly it's due to the wrong name. You cannot require Fox
, since it is a Module
. In ruby you include Modules
.
Good syntax:
include Fox
If you wanna require something from Fox libraries, (what is highly recommended :D), you should require the 'fox16'
library.
Here is a basic window program:
require 'fox16'
include Fox
class Main < FXMainWindow
def initialize(app)
super(app, "Window", :width => 600, :height => 600)
end
def create
super
show(PLACEMENT_SCREEN)
end
end
if __FILE__ == $0
FXApp.new("Window") do |app|
Main.new(app)
app.create
app.run
end
end
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.