SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Oct 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error - "sudo ruby setup.rb"

    Simply Rails pg 35, instructs to execute $sudo ruby setup.rb but when I do so I get the following error message:
    Code:
    rick@odin:/usr/lib/ruby/1.8/rubygems$ sudo ruby setup.rb
    ruby: No such file or directory -- setup.rb (LoadError)
    Previously the book instructs to CD to the rubygems directory. I am running Kubuntu 9.10 and I found the rubygems directory at /usr/lib/ruby/1.8/rubygems. Here is a listing of that directory.
    Code:
    rick@odin:/usr/lib/ruby/1.8/rubygems$ ls
    builder.rb               gem_openssl.rb             server.rb
    command_manager.rb       gem_path_searcher.rb       source_index.rb
    command.rb               gem_runner.rb              source_info_cache_entry.rb
    commands                 indexer.rb                 source_info_cache.rb
    config_file.rb           installer.rb               spec_fetcher.rb
    custom_require.rb        install_update_options.rb  specification.rb
    defaults.rb              local_remote_options.rb    test_utilities.rb
    dependency_installer.rb  old_format.rb              text.rb
    dependency_list.rb       package                    timer.rb
    dependency.rb            package.rb                 uninstaller.rb
    digest                   package_task.rb            user_interaction.rb
    doc_manager.rb           platform.rb                validator.rb
    exceptions.rb            remote_fetcher.rb          version_option.rb
    ext                      requirement.rb             version.rb
    ext.rb                   require_paths_builder.rb
    format.rb                security.rb
    I am having problems with this part and also with installing the "SQLite Database Interface for Ruby" later on.

    Can anyone help with these issues or in getting setup on Kubuntu 9.10? Thanks!

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    This page has a location you can download setup.rb from:

    http://i.loveruby.net/en/projects/setup/

  3. #3
    SitePoint Member
    Join Date
    Oct 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks! When I follow the instructions from the book I get the following results.
    Code:
    rick@odin:/usr/lib/ruby/1.8/rubygems$ sudo ruby setup.rb
    ---> ext
    <--- ext
    ---> ext
    <--- ext
    rm -f InstalledFiles
    ---> ext
    <--- ext
    Now, I am still having a problem installing the SQLite ruby interface. Here is a dump of my terminal showing the versions of everything else that installed okand the attempt to install squlite3-ruby.
    Code:
    rick@odin:/usr/lib/ruby/1.8/rubygems$ ruby -v
    ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux]
    rick@odin:/usr/lib/ruby/1.8/rubygems$ gem -v        
    1.3.5                                               
    rick@odin:/usr/lib/ruby/1.8/rubygems$ rails -v        
    Rails 2.3.4                                           
    rick@odin:/usr/lib/ruby/1.8/rubygems$ sqlite3 --version
    3.6.16
    rick@odin:/usr/lib/ruby/1.8/rubygems$ sudo gem install sqlite3-ruby
    Building native extensions.  This could take a while...
    ERROR:  Error installing sqlite3-ruby:
            ERROR: Failed to build gem native extension.
    
    /usr/bin/ruby1.8 extconf.rb
    checking for fdatasync() in -lrt... yes
    checking for sqlite3.h... no
    *** extconf.rb failed ***
    Could not create Makefile due to some reason, probably lack of
    necessary libraries and/or headers.  Check the mkmf.log file for more
    details.  You may need configuration options.
    
    Provided configuration options:
            --with-opt-dir
            --without-opt-dir
            --with-opt-include
            --without-opt-include=${opt-dir}/include
            --with-opt-lib
            --without-opt-lib=${opt-dir}/lib
            --with-make-prog
            --without-make-prog
            --srcdir=.
            --curdir
            --ruby=/usr/bin/ruby1.8
            --with-sqlite3-dir
            --without-sqlite3-dir
            --with-sqlite3-include
            --without-sqlite3-include=${sqlite3-dir}/include
            --with-sqlite3-lib
            --without-sqlite3-lib=${sqlite3-dir}/lib
            --with-rtlib
            --without-rtlib
    
    
    Gem files will remain installed in /var/lib/gems/1.8/gems/sqlite3-ruby-1.2.5 for inspection.
    Results logged to /var/lib/gems/1.8/gems/sqlite3-ruby-1.2.5/ext/sqlite3_api/gem_make.out
    Any iodeas of wehat I am doing wrong. Btw, this is on AMD 64-bit Kubuntu 9.10. Thanks in advance for any help you can give.

  4. #4
    SitePoint Member
    Join Date
    Oct 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, tried reinstalling ruby from kpackagekit GUI. Documentation is is but still have a problem installing sqlite3-ruby through gem.
    Code:
    rick@odin:/var/lib/gems/1.8/gems$ sudo gem install sqlite3-ruby
    Building native extensions.  This could take a while...
    ERROR:  Error installing sqlite3-ruby:
            ERROR: Failed to build gem native extension.
    
    /usr/bin/ruby1.8 extconf.rb
    extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
            from extconf.rb:1
    
    
    Gem files will remain installed in /var/lib/gems/1.8/gems/sqlite3-ruby-1.2.5 for inspection.
    Results logged to /var/lib/gems/1.8/gems/sqlite3-ruby-1.2.5/ext/sqlite3_api/gem_make.out
    From the Kubuntu GUI I was able to install yhe following packages

    libdataobjects-sqlite3-ruby1.8 - 0.2.5-2 (amd64)
    libsqlite3-ruby1.8 - 1.2.4--2 (amd64)
    libdb-sqlite3-ruby - 1.2.4-2 (all)
    libdbd-sqlite3-runy1.8 - 1.2.4-3 (all)
    libsqlite3-ruby - 1.2.4-2 (all)

    How can I test to see if I have access to SQLite database through ruby? Or else how can I get gem to make the installation?

  5. #5
    Team ********* Louis Simoneau's Avatar
    Join Date
    Sep 2009
    Location
    Melbourne, Australia
    Posts
    228
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    to test if you have sqlite3 available to ruby, just launch an irb console and type:

    Code Ruby:
    require 'sqlite3'

    If that returns true you're all good. Otherwise, to be able to install the gem, you need to have the package ruby1.8-dev installed, that's the package that contains mkmf.rb, so:

    Code:
    sudo apt-get install ruby1.8-dev
    sudo gem install sqlite3-ruby
    Hope that helps


Bookmarks

Posting Permissions

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