Archive for the ‘ruby’ Category

Rails funfando. Problemas com RubyGem não encontrado resolvido

Estava desde hoje de manhã mais cedo tentando fazer um projeto interno (que funciona no sevridor e no computador do programador) funcionar localmente. Após buscas insessantes e tentativas frustradas de solucionar o problema, consegui resolver o problema abaixo:

/vendor/rails/activesupport/lib/active_support/vendor.rb:2:in `require’: no such file to load — rubygems (LoadError)
from /home/ricardo/projetos/rails/dterror-g32-dec87f63f3464e67902a7b7db6615f024e14145f/vendor/rails/activesupport/lib/active_support/vendor.rb:2
from /home/ricardo/projetos/rails/dterror-g32-dec87f63f3464e67902a7b7db6615f024e14145f/vendor/rails/activesupport/lib/active_support.rb:26:in `require’
from /home/ricardo/projetos/rails/dterror-g32-dec87f63f3464e67902a7b7db6615f024e14145f/vendor/rails/activesupport/lib/active_support.rb:26
from /home/ricardo/projetos/rails/dterror-g32-dec87f63f3464e67902a7b7db6615f024e14145f/vendor/rails/railties/lib/commands/server.rb:1:in `require’
from /home/ricardo/projetos/rails/dterror-g32-dec87f63f3464e67902a7b7db6615f024e14145f/vendor/rails/railties/lib/commands/server.rb:1
from ./script/server:3:in `require’
from ./script/server:3

Felizmente, encontrei a solução. Mesmo configurando meu environment corretamente (pelo menos de acotdo com as soluções apontadas nos sites que consultei), ele não estava achando corretamente minhas configurações. O fiz foi simplesmente chamar o ruby pelo caminho.

$: /usr/local/bin/ruby ./script/server
=> Booting Mongrel (use ‘script/server webrick’ to force WEBrick)
=> Rails 2.1.1 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment…
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart).
** Rails signals registered. HUP => reload (without restart). It might not work well.
** Mongrel 1.1.5 available at 0.0.0.0:3000
** Use CTRL-C to stop.

Espero que isso seja útil para alguém.

Até!