Results 1 to 4 of 4

Thread: Ruby

  1. #1
    Join Date
    Jan 2007
    Posts
    688

    Ruby

    My rails application does not start, it displays a 404 error. The application log (public_html/user/log/production.log) contains:

    "MissingSourceFile (no such file to load -- postgres)"

    The error message in the log file contains:
    MissingSourcefile (no such file to load)

    I installed Ruby Gems via whm > apache update and Ruby Rails manually. What else am I to do to get this working? Postgres was compiled as well and has always been installed.


    [email protected] [~]# which postgres
    /usr/bin/postgres



    [email protected] [~]# php -m
    [PHP Modules]
    bcmath
    calendar
    ctype
    curl
    domxml
    eAccelerator
    exif
    ftp
    gd
    gettext
    ionCube Loader
    mbstring
    mcrypt
    mysql
    openssl
    overload
    pcre
    pdf
    pgsql
    posix
    pspell
    session
    sockets
    standard
    swf
    tokenizer
    xml
    xmlrpc
    Zend Optimizer
    zlib

    [Zend Modules]
    Zend Extension Manager
    Zend Optimizer
    the ionCube PHP Loader

  2. #2
    Join Date
    Jan 2007
    Posts
    688
    Ok, still not working after installing postgres module via whm > Module Installers.

    [email protected] [~]# gem list | egrep -v "^( |$)"
    *** LOCAL GEMS ***
    actionmailer (2.0.2, 2.0.1, 1.2.5)
    actionpack (2.0.2, 2.0.1, 1.12.5)
    actionwebservice (1.1.6)
    activerecord (2.0.2, 2.0.1, 1.14.4)
    activeresource (2.0.2, 2.0.1)
    activesupport (2.0.2, 2.0.1, 1.3.1)
    cgi_multipart_eof_fix (2.5.0)
    daemons (1.0.9)
    fastthread (1.0.1)
    fcgi (0.8.7)
    gem_plugin (0.2.3)
    mongrel (1.1.4)
    rails (2.0.2, 2.0.1, 1.1.6)
    rake (0.8.1, 0.7.1)
    rubygems-update (1.0.1)
    sources (0.0.1)


    However, see screenshot of whm where I installed the module. It shows up there, but not in command line.

    http://aycu11.webshots.com/image/489...2274507_rs.jpg

    Still getting this in error logs

    "no such file to load -- postgres"

    And page shows 404.

  3. #3
    Join Date
    Jan 2007
    Posts
    688
    Code:
    [email protected] [/home/user/public_html]# ls -lh
    total 52K
    drwxr-x---   8 user nobody   4.0K Mar 11 08:10 ./
    drwx--x--x  19 user user 4.0K Mar 11 15:35 ../
    -rw-r--r--   1 user user  613 Mar  5 04:42 403.shtml
    -rw-r--r--   1 user user  346 Mar  6 03:36 404.shtml
    drwxr-xr-x   2 user user 4.0K Mar  4 08:49 cgi-bin/
    drwxr-xr-x  13 user user 4.0K Mar  7 17:23 cptech/
    -rw-r--r--   1 user user  734 Mar 11 08:10 .htaccess
    drwxr-xr-x   2 user user 4.0K Mar  5 04:46 html/
    -rw-r--r--   1 user user   75 Mar  5 11:44 index.html
    drwxr-xr-x  13 user user 4.0K Mar  5 04:29 installdir/
    -rw-r--r--   1 user user  245 Mar  5 08:20 notfound.html
    drwxr-xr-x   3 user user 4.0K Mar  5 04:37 scgi-bin/
    drwxr-xr-x   2 user user 4.0K Mar  5 04:36 www/
    index.html is:

    Code:
      GNU nano 1.2.4                                                                   File: index.html                                                                                
    
    <html>
    <body>
    <a href="installdir/public/index.html">mifene</a>
    </body>
    </html>

    Code:
    [email protected] [/home/user/public_html/installdir]# ls -lh
    total 68K
    drwxr-xr-x  13 user user 4.0K Mar  5 04:29 ./
    drwxr-x---   8 user nobody   4.0K Mar 11 08:10 ../
    drwxr-xr-x   6 user user 4.0K Mar  4 08:28 app/
    drwxr-xr-x   4 user user 4.0K Mar 11 17:07 config/
    drwxr-xr-x   3 user user 4.0K Mar  4 08:56 db/
    drwxr-xr-x   2 user user 4.0K Mar  4 08:28 doc/
    drwxr-xr-x   3 user user 4.0K Mar  4 08:56 lib/
    drwxr-xr-x   2 user user 4.0K Mar 11 17:13 log/
    drwxr-xr-x   5 user user 4.0K Mar 11 16:51 public/
    -rw-r--r--   1 user user  307 Mar  4 08:28 Rakefile
    -rw-r--r--   1 user user 8.7K Mar  4 08:28 README
    drwxr-xr-x   4 user user 4.0K Mar  4 08:28 script/
    drwxr-xr-x   7 user user 4.0K Mar  4 08:28 test/
    drwxrwxrwx   6 user user 4.0K Mar  4 08:28 tmp/
    drwxr-xr-x   3 user user 4.0K Mar  4 08:28 vendor/
    Code:
    [email protected] [/home/user/public_html/installdir/public]# ls -lh
    total 52K
    drwxr-xr-x   5 user user 4.0K Mar 11 16:51 ./
    drwxr-xr-x  13 user user 4.0K Mar  5 04:29 ../
    -rw-r--r--   1 user user  947 Mar  9 06:59 404.html
    -rw-r--r--   1 user user  930 Mar  4 08:28 422.html
    -rw-r--r--   1 user user  947 Mar  4 08:28 500.html
    -rwxr-xr-x   1 user user  479 Mar  7 05:09 dispatch.cgi*
    -rwxr-xr-x   1 user user  891 Mar  9 06:53 dispatch.fcgi*
    -rwxr-xr-x   1 user user  479 Mar  7 05:09 dispatch.rb*
    -rw-r--r--   1 user user    0 Mar  4 08:28 favicon.ico
    -rw-r--r--   1 user user 1.3K Mar  9 06:47 .htaccess
    drwxr-xr-x   3 user user 4.0K Mar  4 08:59 images/
    drwxr-xr-x   2 user user 4.0K Mar  4 08:28 javascripts/
    -rw-r--r--   1 user user  204 Mar  4 08:28 robots.txt
    drwxr-xr-x   2 user user 4.0K Mar 11 10:27 stylesheets/
    Log files


    Rendering /home/user/public_html/installdir/public/404.html (500 Error)
    Sent mail:
    Date: Tue, 11 Mar 2008 17:46:13 -0500
    From: Error Notifier <[email protected]>
    To: [email protected], [email protected]
    Subject: [ERROR] home#index (MissingSourceFile) "no such file to load -- postgres"
    Mime-Version: 1.0
    Content-Type: text/plain; charset=utf-8

    A MissingSourceFile occurred in
    home#index:
    no such file to load -- postgres /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'

  4. #4
    Join Date
    Feb 2003
    Location
    Canada
    Posts
    958
    You seem to have two gem paths (as far as I can tell). cPanel wants to use /usr/lib/ruby/gems where as Ruby is looking elsewhere.

    Try installing the gem from the command line: gem install postgres

    Second, try including it by hand in irb
    Code:
    rails:~# irb
    irb(main):001:0> require 'rubygems'
    => true
    irb(main):002:0> require 'postgres'
    => true
    irb(main):003:0>
    You can try pushing your cpanel gem path into your rails app by putting this code in the top of your config/environment.rb
    Code:
    $:.push("/usr/lib/ruby/gems")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •