Shoes require

View: New views
9 Messages — Rating Filter:   Alert me  

Shoes require

by Adam Bengtsson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi. i tried the gui framework shoes today and got some problems trying
to require 'activerecord'. the error message says
~/Desktop/shoes/dist/lib/rubygems/custom_require.rb:27:in
'gem_orginal_require': no such file to load -- activerecord

how do i do to require in shoes?
--
Posted via http://www.ruby-forum.com/.


Re: Shoes require

by Jeremy McAnally :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Try this:

   require 'active_record'

Sometimes it needs the _ and sometimes it doesn't...

--Jeremy

On Jan 1, 2008 1:06 PM, Adam Bengtsson <adam.bengtsson@...> wrote:

> hi. i tried the gui framework shoes today and got some problems trying
> to require 'activerecord'. the error message says
> ~/Desktop/shoes/dist/lib/rubygems/custom_require.rb:27:in
> 'gem_orginal_require': no such file to load -- activerecord
>
> how do i do to require in shoes?
> --
> Posted via http://www.ruby-forum.com/.
>
>



--
http://www.jeremymcanally.com/

My books:
Ruby in Practice
http://www.manning.com/mcanally/

My free Ruby e-book
http://www.humblelittlerubybook.com/

My blogs:
http://www.mrneighborly.com/
http://www.rubyinpractice.com/


Re: Shoes require

by Adam Bengtsson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

didn't work, still the same error. It works when I dont use Shoes so im
a bit confused :/.

Jeremy McAnally wrote:
> Try this:
>
>    require 'active_record'
>
> Sometimes it needs the _ and sometimes it doesn't...
>
> --Jeremy
--
Posted via http://www.ruby-forum.com/.


Re: Shoes require

by Rick DeNatale :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Jan 1, 2008 1:33 PM, Adam Bengtsson <adam.bengtsson@...> wrote:
> didn't work, still the same error. It works when I dont use Shoes so im
> a bit confused :/.


Have you installed the activerecord gem?

$sudo gem install activerecord

ActiveRecord is part of Rails, but can be installed separately.


--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/


Re: Shoes require

by Giles Bowkett :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You can't use gems from within Shoes, at least not in the usual way.
Shoes incorporates its own Ruby interpreter so you need to either give
it an explicit path to ActiveRecord's location or bundle ARec into a
nearby directory in Shoes-land.

Shoes is I think going to have some kind of gems thing going on in the
nearish future but you'd have to check with _why to get the real 411.

--
Giles Bowkett

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com


Re: Shoes require

by Adam Bengtsson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ok. thanks for the help
--
Posted via http://www.ruby-forum.com/.


Re: Shoes require

by Garret Buell :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Jan 1, 2008 11:35 AM, Giles Bowkett <gilesb@...> wrote:
> Shoes incorporates its own Ruby interpreter so you need to either give
> it an explicit path to ActiveRecord's location or bundle ARec into a
> nearby directory in Shoes-land.

This is basically correct. As Shoes does indeed incorporate its own
Ruby interpreter it also has its own collection of relevant gems
already installed. Though there is no mechanism (yet) to install gems
automatically you can manually install them into the nearby directory
in Shoes-land which is ruby/lib.
Basically what I did to get ActiveRecord working was I downloaded
ActiveRecord and ActiveSupport from rubyforge.org. I'm using
ActiveRecord 1.15.6 and ActiveSupport 1.4.4. These are the newest
versions before the move to Rails 2.0. You could probably do it with
the 2.0 versions but I'm sticking back. Then I copied the lib
directories to the ruby/lib directory under shoes. If you do this
you'll notice they fit right in and don't look unusual at all. After
they are copied you can do a simple require 'active_record' and use it
as normal from within shoes. The key thing to note here is that
ActiveRecord depends on ActiveSupport. You can use this trick to
install any gems under shoes as long as you also install their
required dependencies.

I'm guessing you'll also want sqlite working and there seems to be a
problem with sqlite under windows so the solution right now is to
download the newest sqlite3.dll from
http://www.sqlite.org/sqlitedll-3_5_4.zip and put it in the same
directory as the shoes.exe

-Garret Buell


Re: Shoes require

by Giles Bowkett :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

And a footnote copied from a post Garret made on the Shoes list:

> If anyone is interested in getting ferret and acts_as_ferret from
> within shoes for some awesome database indexing goodness you simply
> need to extract the relevant lib files to the shoes ruby/lib folder
> and then:
> RAILS_ROOT = '.'
> RAILS_ENV = 'development'
> require 'acts_as_ferret'
>
> RAILS_ROOT and RAILS_ENV need to be set to fool acts_as_ferret into
> working correctly because it expects to be used from within rails.

there's a Ferret in my Shoes!

--
Giles Bowkett

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com




On 1/1/08, Garret Buell <terragb@...> wrote:

> On Jan 1, 2008 11:35 AM, Giles Bowkett <gilesb@...> wrote:
> > Shoes incorporates its own Ruby interpreter so you need to either give
> > it an explicit path to ActiveRecord's location or bundle ARec into a
> > nearby directory in Shoes-land.
>
> This is basically correct. As Shoes does indeed incorporate its own
> Ruby interpreter it also has its own collection of relevant gems
> already installed. Though there is no mechanism (yet) to install gems
> automatically you can manually install them into the nearby directory
> in Shoes-land which is ruby/lib.
> Basically what I did to get ActiveRecord working was I downloaded
> ActiveRecord and ActiveSupport from rubyforge.org. I'm using
> ActiveRecord 1.15.6 and ActiveSupport 1.4.4. These are the newest
> versions before the move to Rails 2.0. You could probably do it with
> the 2.0 versions but I'm sticking back. Then I copied the lib
> directories to the ruby/lib directory under shoes. If you do this
> you'll notice they fit right in and don't look unusual at all. After
> they are copied you can do a simple require 'active_record' and use it
> as normal from within shoes. The key thing to note here is that
> ActiveRecord depends on ActiveSupport. You can use this trick to
> install any gems under shoes as long as you also install their
> required dependencies.
>
> I'm guessing you'll also want sqlite working and there seems to be a
> problem with sqlite under windows so the solution right now is to
> download the newest sqlite3.dll from
> http://www.sqlite.org/sqlitedll-3_5_4.zip and put it in the same
> directory as the shoes.exe
>
> -Garret Buell
>
>


Re: Shoes require

by huard.elise@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Jan 2, 7:46 am, Giles Bowkett <gil...@...> wrote:

> And a footnote copied from a post Garret made on the Shoes list:
>
> > If anyone is interested in getting ferret and acts_as_ferret from
> > within shoes for some awesome database indexing goodness you simply
> > need to extract the relevant lib files to the shoes ruby/lib folder
> > and then:
> > RAILS_ROOT = '.'
> > RAILS_ENV = 'development'
> > require 'acts_as_ferret'
>
> > RAILS_ROOT and RAILS_ENV need to be set to fool acts_as_ferret into
> > working correctly because it expects to be used from within rails.
>
> there's a Ferret in my Shoes!
>
> --
> Giles Bowkett
>
> Podcast:http://hollywoodgrit.blogspot.com
> Blog:http://gilesbowkett.blogspot.com
> Portfolio:http://www.gilesgoatboy.org
> Tumblelog:http://giles.tumblr.com
>
> On 1/1/08, Garret Buell <terr...@...> wrote:
>
> > On Jan 1, 2008 11:35 AM, Giles Bowkett <gil...@...> wrote:
> > > Shoes incorporates its own Ruby interpreter so you need to either give
> > > it an explicit path to ActiveRecord's location or bundle ARec into a
> > > nearby directory in Shoes-land.
>
> > This is basically correct. As Shoes does indeed incorporate its own
> > Ruby interpreter it also has its own collection of relevant gems
> > already installed. Though there is no mechanism (yet) to install gems
> > automatically you can manually install them into the nearby directory
> > in Shoes-land which is ruby/lib.
> > Basically what I did to get ActiveRecord working was I downloaded
> > ActiveRecord and ActiveSupport from rubyforge.org. I'm using
> > ActiveRecord 1.15.6 and ActiveSupport 1.4.4. These are the newest
> > versions before the move to Rails 2.0. You could probably do it with
> > the 2.0 versions but I'm sticking back. Then I copied the lib
> > directories to the ruby/lib directory under shoes. If you do this
> > you'll notice they fit right in and don't look unusual at all. After
> > they are copied you can do a simple require 'active_record' and use it
> > as normal from within shoes. The key thing to note here is that
> > ActiveRecord depends on ActiveSupport. You can use this trick to
> > install any gems under shoes as long as you also install their
> > required dependencies.
>
> > I'm guessing you'll also want sqlite working and there seems to be a
> > problem with sqlite under windows so the solution right now is to
> > download the newest sqlite3.dll from
> >http://www.sqlite.org/sqlitedll-3_5_4.zipand put it in the same
> > directory as the shoes.exe
>
> > -Garret Buell

Thanks for the tips !