Shoes and require

Helo

I’m playing a little bit around with shoes.
Their i have a problem with require. When i want to require a file witch
is in the same Directory like the Shoes.app File i get a “no such file
to load error”. Is it not possible to require files?

shoesTest.rb:
require “shoesTestb”

Shoes.app do
$app = self
para “lalala”
para lala
end

shoesTestb.rb:
def lala
‘lalafunction’
end

Their i have a problem with require. When i want to require a
para lala
end

shoesTestb.rb:
def lala
‘lalafunction’
end

Apparently, your current directory is not the same as where your files
are and you are invoking your application by path. If so, you need to do
the following before ‘require’:

$: << File.dirname(FILE)

Gennady.

On Thu, Apr 24, 2008 at 01:09:44AM +0900, Gennady B. wrote:

Apparently, your current directory is not the same as where your files
are and you are invoking your application by path. If so, you need to
do the following before ‘require’:

$: << File.dirname(FILE)

If you’re using 1.9, then:

require ‘require_relative’
require_relative(‘feature’)

On Thu, Apr 24, 2008 at 12:59:37AM +0900, Asdf Fsda wrote:

is in the same Directory like the Shoes.app File i get a “no such file
to load error”. Is it not possible to require files?

The require method doesn’t take a filename as a parameter; it takes a
“feature name”. Changing my thinking to this paradigm has saved me from
being frustrated with Ruby for not working the way I expect.

Paul

Paul B. wrote:

On Thu, Apr 24, 2008 at 01:09:44AM +0900, Gennady B. wrote:

Apparently, your current directory is not the same as where your files
are and you are invoking your application by path. If so, you need to
do the following before ‘require’:

$: << File.dirname(FILE)

FILE #=> (eval)
So that doesent work

If you’re using 1.9, then:

Shoes is using 1.8.6

On Thu, Apr 24, 2008 at 12:59:37AM +0900, Asdf Fsda wrote:

is in the same Directory like the Shoes.app File i get a “no such file
to load error”. Is it not possible to require files?

The require method doesn’t take a filename as a parameter; it takes a
“feature name”. Changing my thinking to this paradigm has saved me from
being frustrated with Ruby for not working the way I expect.
My problem is that Shoes is not working the way I expect :wink:

Fabian

_why wrote:

On Thu, Apr 24, 2008 at 05:24:36PM +0900, Asdf Fsda wrote:

Paul B. wrote:

On Thu, Apr 24, 2008 at 01:09:44AM +0900, Gennady B. wrote:

Apparently, your current directory is not the same as where your files
are and you are invoking your application by path. If so, you need to
do the following before ‘require’:

$: << File.dirname(FILE)

FILE #=> (eval)
So that doesent work

Try the more recent 0.r532 builds. Not only should require work,
but $0 and FILE should be set right.

https://code.whytheluckystiff.net/shoes/wiki/RecentBuilds

Thank you for the Tipp
I downloaded shoes-0.r532-intel.dmg tried to start it on OS X 10.5.2 on
an MacBook.
I get this Error: LSOpenFromURLSpec() failed with error -10810 for the
file /Users/fabian.
What can this be?

Fabian

On Thu, Apr 24, 2008 at 05:24:36PM +0900, Asdf Fsda wrote:

Paul B. wrote:

On Thu, Apr 24, 2008 at 01:09:44AM +0900, Gennady B. wrote:

Apparently, your current directory is not the same as where your files
are and you are invoking your application by path. If so, you need to
do the following before ‘require’:

$: << File.dirname(FILE)

FILE #=> (eval)
So that doesent work

Try the more recent 0.r532 builds. Not only should require work,
but $0 and FILE should be set right.

https://code.whytheluckystiff.net/shoes/wiki/RecentBuilds

My apologies.

_why

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs