我无法让这种疯狂的依赖工作,请不要告诉我去Snow Leopard,因为我有一个PPC。
我已经安装了oniguruma,textpow,紫外线。我正在使用rvm这可能是个问题。并不是rvm很糟糕,只是因为我不知道如何让路径正确。
当我启动一个rails应用程序时,我得到的错误表明我错过了ultraviolet
gem,但事实并非如此,因为它列在gem list
下,其他gems正常工作
如果您需要更多信息以及具体信息,请与我们联系:
这是我的错误日志:
Macintosh:sam samgilman $ script / server =>启动WEBrick => Rails 2.3.5应用程序从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已弃用,将被删除在2010年8月或之后。使用#requirement 没有这样的文件加载 - 紫外线 /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: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:164: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 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:169:inprocess' /Users/samgilman/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/initializer.rb:113:in
发送' /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' 脚本/服务器:3 缺少这些必需的宝石: 紫外线
你正在运行: 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 运行rake gems:install
以安装缺少的宝石。 Macintosh:sam samgilman $
答案 0 :(得分:2)
对于Rails 3,Rails 4和Rails 5,您应该有Gemfile
,
gem "ultraviolet", :require => "uv"
答案 1 :(得分:1)
I didn't add :lib => 'uv'
Rails::Initializer.run do |config|
config.gem 'ultraviolet', :lib => 'uv'
end
答案 2 :(得分:0)
安装gem与在Rails配置中声明它不同,尽管它是一个重要的先决条件。
确保您的config / environment.rb至少设置为:
Rails::Initializer.run do |config|
config.gem 'ultraviolet'
end
在使用gem
命令声明宝石之前,不会自动加载宝石。也许它很顽固,所以试试这个:
% irb
> require 'rubygems'
=> true
> gem 'ultraviolet'
=> true
> $:.grep(/ultraviolet/)
=> [...]
最后一行应该显示库$:
的加载路径已经调整为使用你的rvm托管gem。它可能缺失或不正确会阻止宝石正确加载。
如果您使用RVM且环境不一致,则运行错误的ruby
或irb
通常很容易。如果你不小心你的路径,gem
通常会被错误的红宝石束缚。