2014-09-23 110 views
0

我剛剛在Windows 7上安裝了railsinstaller,我在C:/ Sites中創建了一個sample_app文件夾。我用「寶石更新」更新了所有內容。當我想啓動服務器時,我得到了以下錯誤:rails服務器無法啓動 - 錯誤信息

[email protected] /c/Sites/sample_app 
$ rails s 
c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/execjs-2.2.1/lib/execjs/run 
times.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://gi 
thub.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUn 
available) 
    from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/execjs-2.2.1/lib/execjs.rb:5:in `<module:ExecJS>' 
    from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/execjs-2.2.1/lib/execjs.rb:4:in `<top (required)>' 
    from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/uglifier-2.5.3/lib/uglifier.rb:3:in `require' 
    from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/uglifier-2.5.3/lib/uglifier.rb:3:in `<top (required)>' 
    from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:76:in `require' 
    from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require' 
    from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:72:in `each' 
    from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:72:in `block in require' 
    from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:61:in `each' 
    from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:61:in `require' 
    from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.7.3/lib/bundler.rb:133:in `require' 
    from c:/Sites/sample_app/config/application.rb:7:in `<top (required)>' 
    from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:76:in `require' 
    from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:76:in `block in <top (required)>' 
    from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap' 
    from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>' 
    from bin/rails:4:in `require' 
    from bin/rails:4:in `<main>' 
[email protected] /c/Sites/sample_app 
$ 

這裏是我安裝的寶石列表:

[email protected] /c/Sites/sample_app 
$ gem update 
Updating installed gems 
Nothing to update 
[email protected] /c/Sites/sample_app 
$ gem list 

*** LOCAL GEMS *** 

actionmailer (4.1.6, 4.0.0, 3.2.14) 
actionpack (4.1.6, 4.0.0, 3.2.14) 
actionview (4.1.6) 
activemodel (4.1.6, 4.0.0, 3.2.14) 
activerecord (4.1.6, 4.0.0, 3.2.14) 
activerecord-deprecated_finders (1.0.3) 
activerecord-sqlserver-adapter (4.1.0, 3.2.12) 
activeresource (4.0.0, 3.2.14) 
activesupport (4.1.6, 4.0.0, 3.2.14) 
arel (5.0.1.20140414130214, 4.0.2, 3.0.2) 
atomic (1.1.16, 1.1.10) 
bigdecimal (1.2.5, 1.2.0) 
builder (3.2.2, 3.1.4, 3.0.4) 
bundler (1.7.3, 1.3.5) 
coffee-rails (4.0.1, 4.0.0) 
coffee-script (2.3.0, 2.2.0) 
coffee-script-source (1.8.0, 1.6.3) 
erubis (2.7.0) 
execjs (2.2.1, 1.4.0) 
hike (2.1.3, 1.2.3) 
i18n (0.6.11, 0.6.4) 
io-console (0.4.2) 
jbuilder (2.1.3, 1.5.3) 
journey (1.0.4) 
jquery-rails (3.1.2, 3.0.4) 
json (1.8.1, 1.7.7) 
mail (2.6.1, 2.5.4) 
mime-types (2.3, 1.25.1, 1.23) 
minitest (5.4.1, 4.7.5, 4.3.2) 
multi_json (1.10.1, 1.7.7) 
pg (0.17.1 x86-mingw32, 0.16.0 x86-mingw32) 
polyglot (0.3.5, 0.3.3) 
power_assert (0.1.3) 
psych (2.0.6, 2.0.0) 
rack (1.5.2, 1.4.5) 
rack-cache (1.2) 
rack-ssl (1.4.1, 1.3.3) 
rack-test (0.6.2) 
rails (4.1.6, 4.0.0) 
rails-observers (0.1.2) 
railties (4.1.6, 4.0.0) 
rake (10.3.2, 0.9.6) 
rb-readline (0.5.1, 0.5.0) 
rdoc (4.1.2, 4.0.0) 
rubyzip (1.1.6, 0.9.9) 
sass (3.4.5, 3.2.19, 3.2.9) 
sass-rails (4.0.3, 4.0.0) 
sdoc (0.4.1) 
sprockets (2.12.2, 2.11.0, 2.10.0, 2.2.2) 
sprockets-rails (2.1.4, 2.0.1, 2.0.0) 
sqlite3 (1.3.9 x86-mingw32, 1.3.7 x86-mingw32) 
sqlite3-ruby (1.3.3) 
test-unit (3.0.1, 2.0.0.0) 
thor (0.19.1, 0.18.1) 
thread_safe (0.3.4, 0.1.2) 
tilt (2.0.1, 1.4.1) 
tiny_tds (0.6.2 x86-mingw32, 0.6.1 x86-mingw32) 
treetop (1.5.3, 1.4.15, 1.4.14) 
turbolinks (2.3.0) 
tzinfo (1.2.2, 0.3.41, 0.3.37) 
uglifier (2.5.3) 
[email protected] /c/Sites/sample_app 

感謝您的幫助!

回答

0
gem "execjs" 
gem "therubyracer" 

檢查here更多

1

一下添加到您的Gemfile

gem 'therubyracer', :platforms => :ruby 

,做

bundle install 
+0

你能幫助如何添加呢?對於這個命令我得到這個錯誤: '$寶石 'therubyracer':平臺=>:紅寶石 錯誤:在執行寶石...(GEM :: CommandLineError) 未知的命令therubyracer,' 我之前安裝用「$ gem install therubyracer」 – Lanti 2014-09-23 08:37:45

+0

在你的app根文件夾中可以看到Gemfile。只需將此行添加到Gemfile即可。並做捆綁安裝。 – Jyothu 2014-09-23 08:48:50