没有这样的文件加载 - 使用redmine 2.2.2和ubuntu 10.04进行bundler / setup

时间:2013-02-03 15:00:33

标签: ruby-on-rails apache passenger redmine

我收到错误:

no such file to load -- bundler/setup

您可以看到下一张图片:

enter image description here

然而我的捆绑包安装得很好。如果我从redmine/config/命令

运行
 bundle install --without development test postgresql sqlite

我明白了:

Using rake (10.0.3) 
Using i18n (0.6.1) 
Using multi_json (1.5.0) 
Using activesupport (3.2.11) 
Using builder (3.0.0) 
Using activemodel (3.2.11) 
Using erubis (2.7.0) 
Using journey (1.0.4) 
Using rack (1.4.4) 
Using rack-cache (1.2) 
Using rack-test (0.6.2) 
Using hike (1.2.1) 
Using tilt (1.3.3) 
Using sprockets (2.2.2) 
Using actionpack (3.2.11) 
Using mime-types (1.19) 
Using polyglot (0.3.3) 
Using treetop (1.4.12) 
Using mail (2.4.4) 
Using actionmailer (3.2.11) 
Using arel (3.0.2) 
Using tzinfo (0.3.35) 
Using activerecord (3.2.11) 
Using activeresource (3.2.11) 
Using coderay (1.0.8) 
Using rack-ssl (1.3.3) 
Using json (1.7.6) 
Using rdoc (3.12) 
Using thor (0.17.0) 
Using railties (3.2.11) 
Using jquery-rails (2.0.3) 
Using mysql2 (0.3.11) 
Using net-ldap (0.3.1) 
Using ruby-openid (2.1.8) 
Using rack-openid (1.3.1) 
Using bundler (1.2.3) 
Using rails (3.2.11) 
Using rmagick (2.13.1) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

这是我的红宝石-v:

ruby 1.9.3p374 (2013-01-15 revision 38858) [i686-linux]

这是我的导轨-v:

Rails 3.2.11

我已经安装了redmine和ubuntu 12的最新版本并且工作正常,但是使用ubuntu 10.04我收到此错误

这是我的apache默认conf:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/redmine/public
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/redmine>
                RailsBaseURI /redmine
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>
        ErrorLog /var/log/apache2/error.log
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
        CustomLog /var/log/apache2/access.log combined
    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
</VirtualHost>

我的gem env

RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.22
  - RUBY VERSION: 1.9.3 (2012-02-16 patchlevel 125) [i686-linux]
  - INSTALLATION DIRECTORY: /home/ubuntu/.rvm/gems/ruby-1.9.3-p125@rails32
  - RUBY EXECUTABLE: /home/ubuntu/.rvm/rubies/ruby-1.9.3-p125/bin/ruby
  - EXECUTABLE DIRECTORY: /home/ubuntu/.rvm/gems/ruby-1.9.3-p125@rails32/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /home/ubuntu/.rvm/gems/ruby-1.9.3-p125@rails32
     - /home/ubuntu/.rvm/gems/ruby-1.9.3-p125@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

这是我的passenger.conf

<IfModule mod_passenger.c>
  PassengerRoot /usr
  PassengerRuby /usr/bin/ruby
  PassengerDefaultUser www-database
</IfModule>

当我运行ps -fe时,我得到:

root     28771     1  0 06:00 ?        00:00:00 /usr/sbin/apache2 -k start
root     28783 28771  0 06:00 ?        00:00:00 /usr/lib/phusion_passenger/ApplicationPoolServerExecutable 0 /usr/lib/phusion_passenger/passenger-spawn-server  /usr/bin
root     28784 28783  0 06:00 ?        00:00:35 Passenger spawn server                                                                                                  
www-data 28789 28771  0 06:00 ?        00:00:00 /usr/sbin/apache2 -k start
www-data 28790 28771  0 06:00 ?        00:00:00 /usr/sbin/apache2 -k start
www-data 28791 28771  0 06:00 ?        00:00:00 /usr/sbin/apache2 -k start
www-data 28792 28771  0 06:00 ?        00:00:00 /usr/sbin/apache2 -k start
www-data 28793 28771  0 06:00 ?        00:00:00 /usr/sbin/apache2 -k start
www-data 28800 28771  0 06:00 ?        00:00:00 /usr/sbin/apache2 -k start

问题出在哪里?

谢谢!

2 个答案:

答案 0 :(得分:4)

你的Passenger正试图使用​​另一个Ruby而不是你的1.9.3-p374来启动Redmine。正如您从stacktrace中看到的,它尝试使用一些Ruby 1.8(可能是由系统包安装)。

要更改它,您必须configure your Passenger才能使用自定义Ruby。

答案 1 :(得分:1)

Vhost示例

        ServerName bug.domain.com         DocumentRoot / srv / redmine / public

    PassengerRuby /path/to/ruby-x.y.z/bin/ruby
    <Directory /srv/redmine/public>
            AllowOverride all
            Options -MultiViews
    </Directory>

找到ruby可执行文件

首先,转到你的redmine目录:

cd /srv/redmine
gem env | grep -i exec

例如我得到了

RUBY EXECUTABLE: /home/me/.rvm/rubies/ruby-2.0.0-p195/bin/ruby
EXECUTABLE DIRECTORY: /home/me/.rvm/gems/ruby-2.0.0-p195/bin

的Apache

最后将指令 PassengerRuby /path/to/ruby添加到您的vhost并重新加载您的apache配置。