简体   繁体   中英

Missing required but installed gems

My application works fine on my personnal computer, now it's time to deploy !

I try from several hours to deploy my Rails 2 application to a mutualized server. I precise I have not so much permissions on the server, but the vendor says I can run Rails applications.

My config/environment.rb contains 8 config.gem. This is what I got when I run "script/console production" (the real list is the 8 gems)

Missing these required gems:
  will_paginate  = 2.3.16
  ...

But I just installed this gems !

# gem list -l will_paginate
  *** LOCAL GEMS ***
  will_paginate (2.3.16)

I don't know where the bug can be... Here is some complementary informations:

# which ruby
  /usr/bin/ruby
# which gem
  /usr/bin/gem

I have some pre-defined folders related to Rails on my home (~):

~/.gem/specs/gemcutter.org%80/
~/.gem/specs/rubygems.org%80/
~/ruby/bin/gem
~/ruby/gems/ (with bin, cache, doc, gems and specifications subfolders)
~/ruby/gems/gems/will_paginate-2.3.16/ << my gem !
~/ruby/lib/

This is my first deploy and I don't know what to check...

"It works on my computer" is a common problem in any technology....

I'm new to Ruby and discovered two invaluable tools for managing my development and subsequent production environments:

Doesn't solve your immediate issue, but perhaps might be helpful in re-creating your development setup.

I found the solution in this page : http://www.redmine.org/boards/2/topics/5673

The GEM_PATH was not the right one. So I add this line to my config/environment.rb, everything works perfectly !

ENV['GEM_PATH'] = '/home/xxx/ruby/gems'

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM