Skip to content

Instantly share code, notes, and snippets.

@sijokg
Created June 9, 2012 08:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sijokg/f1c33cbe00fb0bbc3edf to your computer and use it in GitHub Desktop.
Save sijokg/f1c33cbe00fb0bbc3edf to your computer and use it in GitHub Desktop.
problem when ran bundle viz
# Don't change this file!
# Configure your app in config/environment.rb and config/environments/*.rb
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
module Rails
class << self
def boot!
unless booted?
preinitialize
pick_boot.run
end
end
def booted?
defined? Rails::Initializer
end
def pick_boot
(vendor_rails? ? VendorBoot : GemBoot).new
end
def vendor_rails?
File.exist?("#{RAILS_ROOT}/vendor/rails")
end
def preinitialize
load(preinitializer_path) if File.exist?(preinitializer_path)
end
def preinitializer_path
"#{RAILS_ROOT}/config/preinitializer.rb"
end
end
class Boot
def run
load_initializer
Rails::Initializer.run(:set_load_path)
end
end
class VendorBoot < Boot
def load_initializer
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
Rails::Initializer.run(:install_gem_spec_stubs)
Rails::GemDependency.add_frozen_gem_path
end
end
class GemBoot < Boot
def load_initializer
self.class.load_rubygems
load_rails_gem
require 'initializer'
end
def load_rails_gem
if version = self.class.gem_version
gem 'rails', version
else
gem 'rails'
end
rescue Gem::LoadError => load_error
$stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
exit 1
end
class << self
def rubygems_version
Gem::RubyGemsVersion rescue nil
end
def gem_version
if defined? RAILS_GEM_VERSION
RAILS_GEM_VERSION
elsif ENV.include?('RAILS_GEM_VERSION')
ENV['RAILS_GEM_VERSION']
else
parse_gem_version(read_environment_rb)
end
end
def load_rubygems
min_version = '1.3.2'
require 'rubygems'
unless rubygems_version >= min_version
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
exit 1
end
rescue LoadError
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
exit 1
end
def parse_gem_version(text)
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
end
private
def read_environment_rb
File.read("#{RAILS_ROOT}/config/environment.rb")
end
end
end
end
class Rails::Boot
def run
load_initializer
Rails::Initializer.class_eval do
def load_gems
@bundler_loaded ||= Bundler.require :default, Rails.env
end
end
Rails::Initializer.run(:set_load_path)
end
end
# All that for this:
Rails.boot!
# Be sure to restart your server when you modify this file
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.8' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
Rails::Initializer.run do |config|
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Add additional load paths for your own custom dirs
config.load_paths += %W( #{RAILS_ROOT}/app/sweepers )
# Specify gems that this application depends on and have them installed with rake gems:install
#config.gem "authlogic"
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Skip frameworks you're not going to use. To use Rails without a database,
# you must remove the Active Record framework.
# config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
# Activate observers that should always be running
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
config.active_record.observers = :activity_observer
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names.
config.time_zone = 'UTC'
config.i18n.default_locale = 'en-US'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
# config.i18n.default_locale = :de
end
Unfortunately, a fatal error has occurred. Please see the Bundler
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/home/sijokg/.rvm/gems/ruby-1.8.7-p358@visual/gems/bundler-1.1.4/lib/bundler/graph.rb:38:in `_populate_relations': undefined method `to_spec' for #<Bundler::Dependency:0xb743eee8> (NoMethodError)
from /home/sijokg/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/set.rb:195:in `each'
from /home/sijokg/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/set.rb:195:in `each_key'
from /home/sijokg/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/set.rb:195:in `each'
from /home/sijokg/.rvm/gems/ruby-1.8.7-p358@visual/gems/bundler-1.1.4/lib/bundler/graph.rb:37:in `_populate_relations'
from /home/sijokg/.rvm/gems/ruby-1.8.7-p358@visual/gems/bundler-1.1.4/lib/bundler/graph.rb:18:in `initialize'
from /home/sijokg/.rvm/gems/ruby-1.8.7-p358@visual/gems/bundler-1.1.4/lib/bundler/cli.rb:519:in `new'
from /home/sijokg/.rvm/gems/ruby-1.8.7-p358@visual/gems/bundler-1.1.4/lib/bundler/cli.rb:519:in `viz'
from /home/sijokg/.rvm/gems/ruby-1.8.7-p358@visual/gems/bundler-1.1.4/lib/bundler/vendor/thor/task.rb:22:in `send'
from /home/sijokg/.rvm/gems/ruby-1.8.7-p358@visual/gems/bundler-1.1.4/lib/bundler/vendor/thor/task.rb:22:in `run'
from /home/sijokg/.rvm/gems/ruby-1.8.7-p358@visual/gems/bundler-1.1.4/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /home/sijokg/.rvm/gems/ruby-1.8.7-p358@visual/gems/bundler-1.1.4/lib/bundler/vendor/thor.rb:263:in `dispatch'
from /home/sijokg/.rvm/gems/ruby-1.8.7-p358@visual/gems/bundler-1.1.4/lib/bundler/vendor/thor/base.rb:386:in `start'
from /home/sijokg/.rvm/gems/ruby-1.8.7-p358@visual/gems/bundler-1.1.4/bin/bundle:13
from /home/sijokg/.rvm/gems/ruby-1.8.7-p358@visual/bin/bundle:19:in `load'
from /home/sijokg/.rvm/gems/ruby-1.8.7-p358@visual/bin/bundle:19
source 'http://rubygems.org'
gem "rails", "2.3.8"
gem "rake", "~> 0.9.2.2"
gem "authlogic", "2.1.6"
gem "fastercsv" ,"1.5.4"
gem "postgres-pr" ,"0.6.3"
gem "rmagick", "~> 2.13.1", :require => "RMagick2"
gem "ar-extensions", "0.9.2"
gem "daemons", "1.1.8"
#Remove system_timer gem if we move to Ruby other than 1.8
gem "system_timer", "~> 1.2.4"
group :development do
gem "mongrel", "1.1.5"
gem "ruby-debug", "~> 0.10.4"
gem "ruby-graphviz", "~> 1.0.5"
end
group :development, :test do
gem 'rspec-rails', '~> 1.3.4' #Note . Rspec will be installed as a dependency
end
group :test do
gem "capybara", "~> 0.3.9"
gem "factory_girl", "~> 1.2.4"
end
GEM
remote: http://rubygems.org/
specs:
actionmailer (2.3.8)
actionpack (= 2.3.8)
actionpack (2.3.8)
activesupport (= 2.3.8)
rack (~> 1.1.0)
activerecord (2.3.8)
activesupport (= 2.3.8)
activeresource (2.3.8)
activesupport (= 2.3.8)
activesupport (2.3.8)
addressable (2.2.8)
ar-extensions (0.9.2)
activerecord (>= 2.1.2)
authlogic (2.1.6)
activesupport
capybara (0.3.9)
culerity (>= 0.2.4)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
selenium-webdriver (>= 0.0.3)
cgi_multipart_eof_fix (2.5.0)
childprocess (0.3.2)
ffi (~> 1.0.6)
columnize (0.3.6)
culerity (0.2.15)
daemons (1.1.8)
factory_girl (1.2.4)
fastercsv (1.5.4)
fastthread (1.0.7)
ffi (1.0.11)
gem_plugin (0.2.3)
libwebsocket (0.1.3)
addressable
linecache (0.46)
rbx-require-relative (> 0.0.4)
mime-types (1.18)
mongrel (1.1.5)
cgi_multipart_eof_fix (>= 2.4)
daemons (>= 1.0.3)
fastthread (>= 1.0.1)
gem_plugin (>= 0.2.3)
multi_json (1.3.4)
nokogiri (1.5.2)
postgres-pr (0.6.3)
rack (1.1.3)
rack-test (0.6.1)
rack (>= 1.0)
rails (2.3.8)
actionmailer (= 2.3.8)
actionpack (= 2.3.8)
activerecord (= 2.3.8)
activeresource (= 2.3.8)
activesupport (= 2.3.8)
rake (>= 0.8.3)
rake (0.9.2.2)
rbx-require-relative (0.0.9)
rmagick (2.13.1)
rspec (1.3.2)
rspec-rails (1.3.4)
rack (>= 1.0.0)
rspec (~> 1.3.1)
ruby-debug (0.10.4)
columnize (>= 0.1)
ruby-debug-base (~> 0.10.4.0)
ruby-debug-base (0.10.4)
linecache (>= 0.3)
ruby-graphviz (1.0.5)
rubyzip (0.9.8)
selenium-webdriver (2.21.2)
childprocess (>= 0.2.5)
ffi (~> 1.0)
libwebsocket (~> 0.1.3)
multi_json (~> 1.0)
rubyzip
system_timer (1.2.4)
PLATFORMS
ruby
DEPENDENCIES
ar-extensions (= 0.9.2)
authlogic (= 2.1.6)
capybara (~> 0.3.9)
daemons (= 1.1.8)
factory_girl (~> 1.2.4)
fastercsv (= 1.5.4)
mongrel (= 1.1.5)
postgres-pr (= 0.6.3)
rails (= 2.3.8)
rake (~> 0.9.2.2)
rmagick (~> 2.13.1)
rspec-rails (~> 1.3.4)
ruby-debug (~> 0.10.4)
ruby-graphviz (~> 1.0.5)
system_timer (~> 1.2.4)
begin
require "rubygems"
require "bundler"
rescue LoadError
raise "Could not load the bundler gem. Install it with `gem install bundler`."
end
if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.24")
raise RuntimeError, "Your bundler version is too old for Rails 2.3." +
"Run `gem install bundler` to upgrade."
end
begin
# Set up load paths for all bundled gems
ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__)
Bundler.setup
rescue Bundler::GemNotFound
raise RuntimeError, "Bundler couldn't find some gems." +
"Did you run `bundle install`?"
end
The command you ran
bundle viz
Exception backtrace(s), if any
Attached below as ExceptionBacktrace
Your Gemfile
Attached below as Gemfile
Your Gemfile.lock
Attached below as Gemfile.lock
Your Bundler configuration settings (run bundle config)
Nothing there
What version of bundler you are using (run bundle -v)
Bundler version 1.1.4
What version of Ruby you are using (run ruby -v)
ruby 1.8.7 (2012-02-08 patchlevel 358) [i686-linux]
What version of Rubygems you are using (run gem -v)
1.4.2
Whether you are using RVM, and if so what version (run rvm -v)
rvm 1.11.6 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.beginrescueend.com/]
Whether you have the rubygems-bundler gem, which can break gem binares
Not using
Whether you have the open_gem gem, which can cause rake activation conflicts
Not using
I am using Rails2.3.8 on fedora14 Below attached
boot.rb
preinitializer.rb
environment.rb
@NewAlexandria
Copy link

it may be your rubygems version, per bundler issue 1993

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment