Когда я пытаюсь загрузить консоль Rails (или загружаю свой сайт с Apache / Passenger), я получаю сообщение об ошибке, что он не может загрузить гем, который я уже установил:
> script/console
Loading development environment (Rails 2.3.8)
no such file to load -- authlogic
/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/rails/gem_dependency.rb:215:in `load'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:307:in `load_gems'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:307:in `each'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:307:in `load_gems'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:164:in `process'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `send'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `run'
/home/nblade/vipreblade/src/console/config/environment.rb:11
/usr/lib/ruby/1.8/irb/init.rb:254:in `require'
/usr/lib/ruby/1.8/irb/init.rb:254:in `load_modules'
/usr/lib/ruby/1.8/irb/init.rb:252:in `each'
/usr/lib/ruby/1.8/irb/init.rb:252:in `load_modules'
/usr/lib/ruby/1.8/irb/init.rb:21:in `setup'
/usr/lib/ruby/1.8/irb.rb:54:in `start'
/usr/bin/irb:13
no such file to load -- machinist
/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/rails/gem_dependency.rb:215:in `load'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:307:in `load_gems'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:307:in `each'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:307:in `load_gems'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:164:in `process'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `send'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `run'
/home/nblade/vipreblade/src/console/config/environment.rb:11
/usr/lib/ruby/1.8/irb/init.rb:254:in `require'
/usr/lib/ruby/1.8/irb/init.rb:254:in `load_modules'
/usr/lib/ruby/1.8/irb/init.rb:252:in `each'
/usr/lib/ruby/1.8/irb/init.rb:252:in `load_modules'
/usr/lib/ruby/1.8/irb/init.rb:21:in `setup'
/usr/lib/ruby/1.8/irb.rb:54:in `start'
/usr/bin/irb:13
no such file to load -- authlogic
/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/rails/gem_dependency.rb:215:in `load'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:307:in `load_gems'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:307:in `each'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:307:in `load_gems'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:169:in `process'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `send'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `run'
/home/nblade/vipreblade/src/console/config/environment.rb:11
/usr/lib/ruby/1.8/irb/init.rb:254:in `require'
/usr/lib/ruby/1.8/irb/init.rb:254:in `load_modules'
/usr/lib/ruby/1.8/irb/init.rb:252:in `each'
/usr/lib/ruby/1.8/irb/init.rb:252:in `load_modules'
/usr/lib/ruby/1.8/irb/init.rb:21:in `setup'
/usr/lib/ruby/1.8/irb.rb:54:in `start'
/usr/bin/irb:13
no such file to load -- machinist
/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/rails/gem_dependency.rb:215:in `load'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:307:in `load_gems'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:307:in `each'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:307:in `load_gems'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:169:in `process'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `send'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `run'
/home/nblade/vipreblade/src/console/config/environment.rb:11
/usr/lib/ruby/1.8/irb/init.rb:254:in `require'
/usr/lib/ruby/1.8/irb/init.rb:254:in `load_modules'
/usr/lib/ruby/1.8/irb/init.rb:252:in `each'
/usr/lib/ruby/1.8/irb/init.rb:252:in `load_modules'
/usr/lib/ruby/1.8/irb/init.rb:21:in `setup'
/usr/lib/ruby/1.8/irb.rb:54:in `start'
/usr/bin/irb:13
Missing these required gems:
authlogic
machinist
You're running:
ruby 1.8.7.249 at /usr/bin/ruby1.8
rubygems 1.3.5 at /var/lib/gems/1.8
Run `rake gems:install` to install the missing gems.
Итак, я следовал инструкциям по установке драгоценных камней следующим образом:
> sudo rake gems:install --trace
(in /home/nblade/vipreblade/src/console)
DEPRECATION WARNING: Rake tasks in vendor/plugins/delayed_job/tasks, vendor/plugins/easy-fckeditor/tasks, vendor/plugins/jrails/tasks, and vendor/plugins/restful_authentication/tasks are deprecated. Use lib/tasks instead. (called from /var/lib/gems/1.8/gems/rails-2.3.8/lib/tasks/rails.rb:10)
** Invoke gems:install (first_time)
** Invoke gems:base (first_time)
** Execute gems:base
** Invoke environment (first_time)
** Execute environment
** Execute gems:install
Он ничего не установил, поэтому я проверяю свое окружение драгоценных камней:
> gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.5
- RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]
- INSTALLATION DIRECTORY: /var/lib/gems/1.8
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /var/lib/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "gem" => "--no-ri --no-rdoc"
- :sources => ["http://gemcutter.org", "http://gems.github.com"]
- REMOTE SOURCES:
- http://gemcutter.org
- http://gems.github.com
> which gem
/usr/bin/gem
> ls -al /usr/bin/gem
lrwxrwxrwx 1 root root 21 2010-07-14 11:29 /usr/bin/gem -> /etc/alternatives/gem
> ls -al /etc/alternatives/gem
lrwxrwxrwx 1 root root 15 2010-07-14 11:29 /etc/alternatives/gem -> /usr/bin/gem1.8
> ls -al /usr/bin/gem1.8
-rwxr-xr-x 1 root root 545 2009-10-09 17:51 /usr/bin/gem1.8
> echo $PATH
/var/lib/gems/1.8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
> echo $GEM_PATH
/var/lib/gems/1.8:
> which ruby
/usr/bin/ruby
> ls -al /usr/bin/ruby
lrwxrwxrwx 1 root root 7 2010-07-13 19:54 /usr/bin/ruby -> ruby1.8
> ls -al /usr/bin/ruby1.8
-rwxr-xr-x 1 root root 5488 2010-03-19 10:53 /usr/bin/ruby1.8
> /usr/bin/ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]
Я также проверил, что камни УСТАНОВЛЕНЫ:
> ls -al /var/lib/gems/1.8/gems | grep authlogic
drwxr-xr-x 7 root root 4096 2010-08-03 12:14 authlogic-2.1.5
> ls -al /var/lib/gems/1.8/gems | grep machinist
drwxr-xr-x 4 root root 4096 2010-08-03 12:14 machinist-1.0.6
Итак, очевидно, что я делаю что-то не так, но я не уверен, что еще нужно проверить. Есть предложения?
Спасибо.