2013-08-20 32 views
1

我遇到的最難的錯誤 - 會愛你們都幫忙! (還在學習和初學者)。Rails服務器錯誤:「無法找到RubyGem鐵軌(> = 0)(Gem :: LoadError)」

我嘗試過在Heroku上部署,現在我的應用程序在Heroku和本地都無法工作。

試圖現在只修復當地的情況。

我改變的其他東西是database.yml文件。它現在使用postgresql,但在我的GemFile中,我指定了sqlite3進行測試。

rails s 
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:777:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError) 
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:211:in `activate' 
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:1056:in `gem' 
    from /usr/bin/rails:18 

我的Gemfile:

source 'https://rubygems.org' 

#ruby '2.0.0' 

gem 'rails', '3.2.3' 

# Bundle edge Rails instead: 
# gem 'rails', :git => 'git://github.com/rails/rails.git' 

group :development, :test do 
    gem 'sqlite3' 
end 

group :production do 
    gem 'pg' 
end 


# Gems used only for assets and not required 
# in production environments by default. 
group :assets do 
    gem 'sass-rails', '~> 3.2.3' 
    gem 'coffee-rails', '~> 3.2.1' 

    # See https://github.com/sstephenson/execjs#readme for more supported runtimes 
    # gem 'therubyracer', :platform => :ruby 

    gem 'uglifier', '>= 1.0.3' 
end 

gem 'jquery-rails' 

gem 'paperclip' 

bundle install,並得到了以下消息(我必須從這個信息做什麼?):

根據您的紅寶石的版本,你可能需要安裝紅寶石rdoc/ri數據:

Your bundle is complete! 
Use `bundle show [gemname]` to see where a bundled gem is installed. 
Post-install message from rdoc: 
<= 1.8.6 : unsupported 
= 1.8.7 : gem install rdoc-data; rdoc-data --install 
= 1.9.1 : gem install rdoc-data; rdoc-data --install 
>= 1.9.2 : nothing to do! Yay! 
Post-install message from paperclip: 
################################################## 
# NOTE FOR UPGRADING FROM PRE-3.0 VERSION  # 
################################################## 

Paperclip 3.0 introduces a non-backward compatible change in your attachment 
path. This will help to prevent attachment name clashes when you have 
multiple attachments with the same name. If you didn't alter your 
attachment's path and are using Paperclip's default, you'll have to add 
`:path` and `:url` to your `has_attached_file` definition. For example: 

    has_attached_file :avatar, 
     :path => ":rails_root/public/system/:attachment/:id/:style/:filename", 
     :url => "/system/:attachment/:id/:style/:filename" 
+1

你有沒有試過做'捆綁安裝'? –

+0

啊!一個熟悉的錯誤信息。它說Ruby版本是2.0.0,但是Gemfile指定了1.8。將調查並報告。 – dngoo

+0

我的本地服務器現在可以使用!謝謝。 「<= 1.8.6:不支持」是什麼意思?我需要做什麼嗎? – dngoo

回答

2

而不是運行

rails s 

運行

bundle exec rails s 

,以確保您使用的Gemfile中,而不是當地的寶石引用的寶石。

相關問題