2013-07-22 39 views
-1

我剛剛在http://rubyinstaller.org/上安裝了Ruby on Rails軟件包(這是我第一次嘗試在我的xp sp3系統中設置ruby on rails工作站)。安裝過程完美無缺。我使用它的控制檯啓動了服務器。服務器已啓動,但http:// localhost:3000顯示錯誤頁面(未找到頁面)。 我在控制檯中顯示如下:我錯過了什麼?Rails服務器已啓動,但localhost:3000顯示錯誤

#Rails Environment Configuration. 

--- 
git: 
    user.name: XYZ 
    user.email: xyzuser 
    version: git version 1.8.1.msysgit.1 

ruby: 
    bin:  C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe 
    version: ruby 1.9.3p392 (2013-02-22) [i386-mingw32] 

rails: 
    bin:  C:/RailsInstaller/Ruby1.9.3/bin/rails.bat 
    version: Rails 3.2.13 

ssh: 
    public_key_location: C:\Documents and Settings\xyz/.ssh/id_rsa.pub 
    public_key_contents: ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEArYKMRvMHxKJ2R//5viqQp 
D4IQhVcKZhhbfvZGzDOXF1M//pewAQDK2x9y8T8irvatgmDMCYB5L2uZiyXwG3gPm6Bfw44mCHhNP8xN 
bT2OSDnvIoZcFVfmQExZmwWcSNqm0NionObUV+IFKvfjg9bOPl4GBUqSXSTlUmAn/wQq0c/m+GoJwDlI 
dV/h69dq4tHYwpCMFUZ9k4LqR4VICktV5Fi1VQA14u4Y9kOWAAyAfzeXnOzcpkbYxgjbCvAf20gM6lSL 
9NvNsLuzI5yLxhI5wAmZbK+11zgNmx019tbv1uHvZRV2Z53aWpErtuvipAieQ977U4kYQPMyFf8g8BKd 
Q== XYZ<xyzuser> 




C:\Sites> 

和控制檯輸出在服務器啓動是:

C:\Sites>rails s 
Usage: 
    rails new APP_PATH [options] 

Options: 
    -r, [--ruby=PATH]    # Path to the Ruby binary of your choice 
           # Default: C:/RailsInstaller/Ruby1.9.3/bin/ruby 
.exe 
    -b, [--builder=BUILDER]  # Path to a application builder (can be a files 
ystem path or URL) 
    -m, [--template=TEMPLATE]  # Path to an application template (can be a fil 
esystem path or URL) 
     [--skip-gemfile]   # Don't create a Gemfile 
     [--skip-bundle]   # Don't run bundle install 
    -G, [--skip-git]    # Skip Git ignores and keeps 
    -O, [--skip-active-record]  # Skip Active Record files 
    -S, [--skip-sprockets]   # Skip Sprockets files 
    -d, [--database=DATABASE]  # Preconfigure for selected database (options: 
mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3 
/jdbcpostgresql/jdbc) 
           # Default: sqlite3 
    -j, [--javascript=JAVASCRIPT] # Preconfigure for selected JavaScript library 
           # Default: jquery 
    -J, [--skip-javascript]  # Skip JavaScript files 
     [--dev]     # Setup the application with Gemfile pointing t 
o your Rails checkout 
     [--edge]     # Setup the application with Gemfile pointing t 
o Rails repository 
    -T, [--skip-test-unit]   # Skip Test::Unit files 
     [--old-style-hash]   # Force using old style hash (:foo => 'bar') on 
Ruby >= 1.9 

Runtime options: 
    -f, [--force] # Overwrite files that already exist 
    -p, [--pretend] # Run but do not make any changes 
    -q, [--quiet] # Suppress status output 
    -s, [--skip]  # Skip files that already exist 

Rails options: 
    -h, [--help]  # Show this help message and quit 
    -v, [--version] # Show Rails version number and quit 

Description: 
    The 'rails new' command creates a new Rails application with a default 
    directory structure and configuration at the path you specify. 

    You can specify extra command-line arguments to be used every time 
    'rails new' runs in the .railsrc configuration file in your home directory. 

    Note that the arguments specified in the .railsrc file don't affect the 
    defaults values shown above in this help message. 

Example: 
    rails new ~/Code/Ruby/weblog 

    This generates a skeletal Rails installation in ~/Code/Ruby/weblog. 
    See the README in the newly created application to get going. 

C:\Sites> 
+1

可否請您添加控制檯輸出,你看到當starying rails – roody

+0

是的,我已經發布它的問題。 –

回答

0

您在創建Rails項目的目錄必須cd,然後rails s應該工作正常。

這也意味着服務器尚未啓動。請仔細閱讀控制檯命令的輸出,大部分時間他們會告訴您他們的工作,或者他們爲什麼不按預期工作。

+0

是的,我也創建了一個rails項目......它看起來像這樣** C:\ Sites \ railsbridge \ test_app ** –

+0

然後執行'cd railsbridge \ test_app',並且在'rails s'之後,服務器將運行。 – contradictioned

+0

PS:正在運行的服務器將產生一個控制檯輸出,例如'=> Rails 3.2.11應用程序在http://0.0.0.0:3000'上的開發中開始並且「>>聽取0.0.0.0:3000,CTRL + C到停止' - 如果你看了這樣的東西,你可以嘗試在瀏覽器中;) – contradictioned

0

服務器未啓動。您需要導航到你的Rails應用程序文件夾,安裝所需的寶石並啓動服務器:

所有你需要創建一個新的Rails項目的
cd <your app folder> 
bundle install 
rails s 
+0

我對你提到的命令行感到困惑。你能把它們寫下來嗎? –

+0

當然請參閱更新的響應 – roody

+0

錯誤:'C:\網站> CD railsbridge C:\網站\ railsbridge> CD test_app C:\網站\ railsbridge \ test_app>軌道小號 ←[31mCould找不到寶石「 uglifier(> = 1.0.3)x86-mingw32'在該機器上的寶石可用 。←[0m ←[33mRun'bundle install'安裝缺少的寶石。←[0m C:\ Sites \ railsbridge \ test_app>' –

0

第一。我認爲C:/ Sites不是你的rails項目目錄。

rails new test_app 

它會在您的目錄中創建一個rails項目。比去cd test_app。並嘗試啓動您的服務器。 希望它能起作用。

1

謝謝大家。最後我得到了它的工作。問題是我的test_app文件夾中的Gemfile。我評論了該行gem'uglifier','> = 1.0.3',我得到了它的工作。希望它能進一步發揮作用,讓我繼續前進。

+0

你可能仍然需要這個Gem(或者遇到這個Gemfile的其他gem問題),那麼你可以用一個叫做bundler的程序自動安裝這些gem。這應該已經與您的導軌安裝一起安裝,請參閱http://bundler.io/v1.3/bundle_install.html以獲取詳細信息。 – contradictioned

+0

謝謝,是的,我做到了。 –

相關問題