Forum: Ruby on Rails Freeze gems

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
595473377f19726698a32a8046f6659f?d=identicon&s=25 josh_richard (Guest)
on 2009-02-02 20:12
(Received via mailing list)
Hello everyone.  Anyone run into this problem?

I have an rails app which is running rails 2.2.2 with rubygems 1.2.0
on a dev box.  Rails is frozen and in SVN.  The hosting server is
running gems 0.9 which appears to be incompatible with rails 2.x.  Is
there a way to freeze rubygems (aka, gem) into a rails project so I do
not impact other's applications?

What I have done (using 1.3.1 as a test case):

wget http://rubyforge.org/frs/download.php/45905/rubyge...
tar zxvf rubygems-1.3.1.tgz
mv rubygems-1.3.1/lib <project>lib/rubygems
cd <project>
svn add lib/rubygems
svn ci -m 'added libraries'
rake deploy (to push app into production)

The idea was I would place the lib/rubygems directory ahead of
everything in the load path...

edit config/environment.rb
# Add additional load paths for your own custom dirs
config.load_paths.insert(0, %W( #{RAILS_ROOT}/lib/rubygems/lib ).to_s)

on the dev box this looks correct (./script/about):

About your application's environment
Ruby version              1.8.7 (i486-linux)
RubyGems version          1.3.1
Rails version             2.2.2
Active Record version     2.2.2
Action Pack version       2.2.2
Active Resource version   2.2.2
Action Mailer version     2.2.2
Active Support version    2.2.2

On production it still is using the older version.:
./script/about
./script/../config/../vendor/rails/railties/lib/initializer.rb:214:in
`install_gem_spec_stubs': undefined method `loaded_specs' for
Gem:Module (NoMethodError)

It appears to still load 0.9.6 on the way.

Regards,

Josh Richard
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-02-02 20:22
(Received via mailing list)
On 2 Feb 2009, at 17:59, josh_richard wrote:

>
> Hello everyone.  Anyone run into this problem?
>
> I have an rails app which is running rails 2.2.2 with rubygems 1.2.0
> on a dev box.  Rails is frozen and in SVN.  The hosting server is
> running gems 0.9 which appears to be incompatible with rails 2.x.  Is
> there a way to freeze rubygems (aka, gem) into a rails project so I do
> not impact other's applications?
>

You probably want to fiddle with $: right at the top of environment.rb

Fred
595473377f19726698a32a8046f6659f?d=identicon&s=25 josh_richard (Guest)
on 2009-02-02 20:45
(Received via mailing list)
> You probably want to fiddle with $: right at the top of environment.rb
>
> Fred

Thanks Fred,

This did not work.

Josh
595473377f19726698a32a8046f6659f?d=identicon&s=25 josh_richard (Guest)
on 2009-02-02 23:24
(Received via mailing list)
Fred,

I followed this link since it was close to what was needed.  I added
the ENV variables to the rails project with no success.

http://www.rubygems.org/read/chapter/15#page101

There are may examples on the net about how to freeze gems, but I am
not finding any documentation about how to freeze rubygems itself.

This seems like a problem which should be common to site host ISPs.

thanks, all.

Josh
This topic is locked and can not be replied to.