Rubygems LoadError in Rails

Each time I run my Rails applications, I get a LoadError with the following output.

In Rails 2.3.8:

no such file to load - sqlite3 / sqlite3_native
<internal: lib / rubygems / custom_require>: 29: in `require '

In Rails 3.0.0:

no such file to load - bundler
<internal: lib / rubygems / custom_require>: 29: in `require '

I run applications in production mode on a development machine using Nginx + Passenger.

What is the cause of this problem? How can I solve it?

Thank.

Debian GNU / Linux 5.0.6;

Ruby 1.9.2;

Rubygems 1.3.7;

Ruby on Rails 2.3.8, 3.0.0;

Nginx 0.8.50;

Passenger 2.2.15;

sqlite3-ruby 1.3.1;

bundler 1.0.0.rc.6.

Update


All my gems are set by an unprivileged user in a local directory /home/<usernam>/.gem. If this helps, here's the conclusion gem env:

RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.9.2 (2010-08-18 patchlevel 0) [i686-linux]
  - INSTALLATION DIRECTORY: /home/<username>/.gem
  - RUBY EXECUTABLE: /usr/local/bin/ruby
  - EXECUTABLE DIRECTORY: /home/<username>/.gem/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /home/<username>/.gem
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-ri --no-rdoc"
     - :gemhome => "/home/<username>/.gem"
     - :gempath => ["/home/<username>/.gem"]
  - REMOTE SOURCES:
     - http://rubygems.org/


. , gem. ~/.gemrc :

:gemhome: /home/<username>/.gem
:gempaths:
  - /home/<username>/.gem

, , . - Rubygems .

, Rubygems, , Rails, .

:

  • Nginx + Passenger;
  • gempath /home/<unprivileged_user>/.gem ~/.gemrc;
  • init.d script (update-rc.d nginx defaults);
  • , ;
  • http://localhost/my_rails_app;
  • LoadError; - ; : 29: in `require '.

Rubygems , ?. .

+5
2

RVM - gemset - , . , rvm guide, RVM gemset /, gemset, gemset. , gemset rails 2.3.8:


$rvm gemset create rails238


$rvm ruby-1.8.7@rails238


$gem install rails -v 2.3.8


, , rvm gemset [gemsetName] rmm gemset, gemset, , , rails -v, 2.3. 8

+2

, , ( ", " " " ). (/usr/bin /usr/local ). , . .

0

All Articles