2011-09-02 59 views
4

剛剛在Rails中啓動。我在Windows Vista上,從http://rubyinstaller.org/安裝了紅寶石的最新版本,一切都很順利。啓動Rails服務器時出現問題

ruby -v 
ruby 1.9.2p290 (2011-07-09) [i386-mingw32] 

我運行:

gem update --system 
gem sources -a http://gemcutter.org 
gem install rails 

報道沒有錯誤。

rails --v 
Rails 3.1.0 

在此之後我創建了一個文件夾,我的Rails項目,我創建了一個新的Rails應用程序內部如下:

rails new test 
cd test 
bundle install 

(同樣沒有錯誤報告)

但是當我運行rails server我得到這個錯誤:

rails server 
←[31mCould not find rails-3.1.0 in any of the sources←[ 
←[33mRun `bundle install` to install missing gems.←[0m 

我嘗試再次運行包,但沒有再次成功...在此之後,如果我再次鍵入rails -v,則會收到與以前相同的錯誤。我必須關閉Windows控制檯並重新打開rails -v才能重新開始工作!

有沒有人遇到過這個?你能幫我嗎?

謝謝!

由於要求的Gemfile內容是:

source 'http://rubygems.org' 

gem 'rails', '3.1.0' 

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

gem 'sqlite3' 


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

gem 'jquery-rails' 

# Use unicorn as the web server 
# gem 'unicorn' 

# Deploy with Capistrano 
# gem 'capistrano' 

# To use debugger 
# gem 'ruby-debug19', :require => 'ruby-debug' 

group :test do 
    # Pretty printed test output 
    gem 'turn', :require => false 
end 

捆綁安裝結果:

Fetching source index for http://rubygems.org/ 
Using rake (0.9.2) 
Using multi_json (1.0.3) 
Using activesupport (3.1.0) 
Using bcrypt-ruby (3.0.0) 
Using builder (3.0.0) 
Using i18n (0.6.0) 
Using activemodel (3.1.0) 
Using erubis (2.7.0) 
Using rack (1.3.2) 
Using rack-cache (1.0.3) 
Using rack-mount (0.8.3) 
Using rack-test (0.6.1) 
Using hike (1.2.1) 
Using tilt (1.3.3) 
Using sprockets (2.0.0) 
Using actionpack (3.1.0) 
Using mime-types (1.16) 
Using polyglot (0.3.2) 
Using treetop (1.4.10) 
Using mail (2.3.0) 
Using actionmailer (3.1.0) 
Using arel (2.2.1) 
Using tzinfo (0.3.29) 
Using activerecord (3.1.0) 
Using activeresource (3.1.0) 
Using ansi (1.3.0) 
Using bundler (1.0.18) 
Using coffee-script-source (1.1.2) 
Using execjs (1.2.4) 
Using coffee-script (2.2.0) 
Using rack-ssl (1.3.2) 
Using rdoc (3.9.4) 
Using thor (0.14.6) 
Using railties (3.1.0) 
Using coffee-rails (3.1.0) 
Using jquery-rails (1.0.13) 
Installing rails (3.1.0) 
Using sass (3.1.7) 
Using sass-rails (3.1.0) 
Using sqlite3 (1.3.4) 
Using turn (0.8.2) 
Using uglifier (1.0.2) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem 
is installed. 
+0

什麼是您的Gemfile樣子? Bundler的輸出是什麼?你在使用RVM嗎? –

+0

感謝您的回覆!關於RVM,我很害怕,我不知道它是什麼......現在閱讀一下,但是它是自動安裝的,或者我沒有它......請求的其他信息在原始文章中! – jribeiro

+0

RVM一般用於linux/mac/* nix,除非你使用cygwin,我懷疑,因爲你從http://rubyinstaller.org安裝ruby&rails。 – Augusto

回答

7

嘗試bundle exec rails server代替rails server

+1

我試過了,但是這次得到了這條消息:「在任何來源找不到rails-3.1.0」 – jribeiro

+0

請確保你的'vendor'目錄中沒有'rails' –

+0

i'很抱歉,供應商意味着什麼? – jribeiro