views:

115

answers:

2

I cannot get this crazy dependency to work and please don't tell me to go to Snow Leopard because I have a PPC.

I have oniguruma, textpow, ultraviolet all installed. I'm using rvm which is probably the problem. Not that rvm is bad it's just that I don't know how to get the paths correct.

When I startup a rails app the error I'm getting states that I'm missing the ultraviolet gem which is not really the case because it's listed under gem list with other gems which are working correctly.

Let me know if you need more information and what kinda specific info:

Here is my error log:

Macintosh:sam samgilman$ script/server => Booting WEBrick => Rails 2.3.5 application starting on http://0.0.0.0:3000 /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/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 no such file to load -- ultraviolet /Users/samgilman/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' /Users/samgilman/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in require' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:innew_constants_in' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in require' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/rails/gem_dependency.rb:208:inload' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/initializer.rb:307:in load_gems' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/initializer.rb:307:ineach' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/initializer.rb:307:in load_gems' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/initializer.rb:164:inprocess' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/initializer.rb:113:in send' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/initializer.rb:113:inrun' /Users/samgilman/Sites/sam/config/environment.rb:9 /Users/samgilman/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' /Users/samgilman/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in require' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:innew_constants_in' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in require' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/commands/server.rb:84 /Users/samgilman/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require' /Users/samgilman/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require' script/server:3 no such file to load -- ultraviolet /Users/samgilman/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require' /Users/samgilman/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:inrequire' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in new_constants_in' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:inrequire' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/rails/gem_dependency.rb:208:in load' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/initializer.rb:307:inload_gems' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/initializer.rb:307:in each' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/initializer.rb:307:inload_gems' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/initializer.rb:169:in process' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/initializer.rb:113:insend' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/initializer.rb:113:in run' /Users/samgilman/Sites/sam/config/environment.rb:9 /Users/samgilman/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require' /Users/samgilman/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:inrequire' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in new_constants_in' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:inrequire' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/commands/server.rb:84 /Users/samgilman/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' /Users/samgilman/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire' script/server:3 Missing these required gems: ultraviolet
You're running: ruby 1.8.7.302 at /Users/samgilman/.rvm/rubies/ruby-1.8.7-p302/bin/ruby rubygems 1.3.7 at /Users/samgilman/.rvm/gems/ruby-1.8.7-p302, /Users/samgilman/.rvm/gems/ruby-1.8.7-p302@global Run rake gems:install to install the missing gems. Macintosh:sam samgilman$

A: 

Having the gem installed is not the same as declaring it in your Rails configuration, though it is an important prerequisite.

Make sure you have your config/environment.rb set with at least:

Rails::Initializer.run do |config|
  config.gem 'ultraviolet'
end

Gems are not automatically loaded until you declare them with the gem command. Maybe it's being stubborn, so try this:

% irb
> require 'rubygems'
 => true
> gem 'ultraviolet'
 => true
> $:.grep(/ultraviolet/)
 => [...]

The final line should show that the load path for libraries $: has been adjusted to use your rvm managed gem. It might be missing or incorrect which would prevent the gem from loading properly.

It's often easy to run the wrong ruby or irb if you're using RVM and your environment isn't consistent. gem can often get bound to the wrong ruby if you're not careful about your path.

tadman
+1  A: 

I didn't add :lib => 'uv'

Rails::Initializer.run do |config|
    config.gem 'ultraviolet', :lib => 'uv'
end
Sam