SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Member
    Join Date
    Mar 2010
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Problem on page 133 of Simply Rails 2

    Hey guys not sure whats going on here.

    Code:
    [root@jayvm shovell]# ruby script/console
    Loading development environment (Rails 2.3.5)
    >> s = Story.new
    MissingSourceFile: no such file to load -- sqlite3
    	from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    	from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    	from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    	from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
    	from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    	from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/requires.rb:7:in `require_library_or_gem'
    	from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
    	from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/requires.rb:5:in `require_library_or_gem'
    	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/sqlite3_adapter.rb:10:in `sqlite3_connection'
    	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `send'
    	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection'
    	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'
    	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `checkout'
    	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `loop'
    	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `checkout'
    	from /usr/lib/ruby/1.8/monitor.rb:238:in `synchronize'
    	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout'
    	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection'
    	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'
    	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection'
    	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection'
    	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1271:in `columns'
    	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:3014:in `attributes_from_column_definition_without_lock'
    	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/locking/optimistic.rb:55:in `attributes_from_column_definition'
    	from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2434:in `initialize'
    	from (irb):1:in `new'
    	from (irb):1>>
    however db:migrate works fine:

    Code:
    [root@jayvm shovell]# rake db:migrate
    (in /var/www/jaymerritt.com/shovell)
    [root@jayvm shovell]#
    also

    Code:
    [root@jayvm shovell]# gem list
    
    *** LOCAL GEMS ***
    
    actionmailer (2.3.5)
    actionpack (2.3.5)
    activerecord (2.3.5)
    activeresource (2.3.5)
    activesupport (2.3.5)
    fastthread (1.0.7)
    mysql (2.8.1)
    passenger (2.2.11)
    rack (1.1.0, 1.0.1)
    rails (2.3.5)
    rake (0.8.7)
    sqlite3-ruby (1.2.5)
    [root@jayvm shovell]#
    i can't figure out what could be wrong.
    Last edited by Crambler; Mar 30, 2010 at 10:21. Reason: added info

  2. #2
    SitePoint Enthusiast
    Join Date
    Jan 2010
    Location
    Cleveland, OH
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    will you show me the config/database.yml file?

  3. #3
    SitePoint Member
    Join Date
    Mar 2010
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello!
    Thank you for your response.
    Code:
    [root@jayvm config]# cat database.yml
    # SQLite version 3.x
    #   gem install sqlite3-ruby (not necessary on OS X Leopard)
    development:
      adapter: sqlite3
      database: db/development.sqlite3
      pool: 5
      timeout: 5000
    
    # Warning: The database defined as "test" will be erased and
    # re-generated from your development database when you run "rake".
    # Do not set this db to the same as development or production.
    test:
      adapter: sqlite3
      database: db/test.sqlite3
      pool: 5
      timeout: 5000
    
    production:
      adapter: sqlite3
      database: db/production.sqlite3
      pool: 5
      timeout: 5000
    [root@jayvm config]

  4. #4
    SitePoint Enthusiast
    Join Date
    Jan 2010
    Location
    Cleveland, OH
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your db file looks fine.

    Try this.

    Go to config/environment.rb, unless you have already altered this file there should be commented out line that reads:

    # config.gem "sqlite3-ruby", :lib => "sqlite3"
    uncomment this line by deleting the # and save the file. Go back to your terminal/command prompt (make sure you are in the root directory of your app) and use:

    rake gems:install

    After that has executed try running the console.

  5. #5
    SitePoint Member
    Join Date
    Mar 2010
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's what happened.

    Code:
    [root@jayvm shovell]# ruby script/console
    Loading development environment (Rails 2.3.5)
    /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010.  Use #requirement
    Missing these required gems:
      sqlite3-ruby  
    
    You're running:
      ruby 1.8.5 at /usr/bin/ruby
      rubygems 1.3.6 at /root/.gem/ruby/1.8, /usr/lib/ruby/gems/1.8
    
    Run `rake gems:install` to install the missing gems.
    [root@jayvm shovell]# rake gems:install
    (in /var/www/jaymerritt.com/shovell)
    [root@jayvm shovell]# ruby script/console
    Loading development environment (Rails 2.3.5)
    /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010.  Use #requirement
    Missing these required gems:
      sqlite3-ruby  
    
    You're running:
      ruby 1.8.5 at /usr/bin/ruby
      rubygems 1.3.6 at /root/.gem/ruby/1.8, /usr/lib/ruby/gems/1.8
    
    Run `rake gems:install` to install the missing gems.
    [root@jayvm shovell]#

  6. #6
    SitePoint Member
    Join Date
    Mar 2010
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wait i am having conflicting paths i think.

  7. #7
    SitePoint Member
    Join Date
    Mar 2010
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah i want to be running off the enterprise installation.

    Code:
    [root@jayvm shovell]# locate gem_dependency.rb
    /home/rubygems-1.3.1/test/test_gem_dependency.rb
    /home/rubygems-1.3.5/test/test_gem_dependency.rb
    /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb
    /root/Temp/Sources/ruby-enterprise-1.8.7-2010.01/rubygems/test/test_gem_dependency.rb
    /usr/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/rails/gem_dependency.rb
    /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb
    /usr/lib/ruby/gems/1.8/gems/rubygems-update-1.3.5/test/test_gem_dependency.rb
    /usr/lib/ruby/gems/1.8/gems/rubygems-update-1.3.6/test/test_gem_dependency.rb
    [root@jayvm shovell]#
    ugh

  8. #8
    SitePoint Member
    Join Date
    Mar 2010
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How do I tell ruby which gems to be using?

  9. #9
    SitePoint Enthusiast
    Join Date
    Jan 2010
    Location
    Cleveland, OH
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looks like you have both Rails 2.3.3 and 2.3.5, but it also looks like the enterprise edition is the one you are using since it is v2.3.5. To create an app using a specific rails version you use

    rails _2.3.x_ app

    In this case it maybe easier to freeze the version of rails you are using

    rake rails:freeze:gems

    This saves the version of rails your app is using to vendors/plugins directory and your app is then locked into that version. If later you want to upgrade use

    rake rails:unfreeze

  10. #10
    SitePoint Member
    Join Date
    Mar 2010
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    haha fug i am so confused.

  11. #11
    SitePoint Enthusiast
    Join Date
    Jan 2010
    Location
    Cleveland, OH
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What can I do to help?

  12. #12
    SitePoint Member
    Join Date
    Mar 2010
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you.
    i just purged the server and did a fresh reinstall.
    everything is better now. but about to make a new post!


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
  •