1

对 Ruby on Rails 来说是全新的。我的环境是 Windows 2008 R2,我只是使用 RailsInstaller 来设置它。我得到了一个网站,所以我把它放在 C:\Sites 下。我按照指南安装了rails,你可以在代码中看到版本。然后我运行“rails server”来尝试启动该服务,但是我收到了关于“therubyracer-heroku-0.8.1.pre3 not installed, 所以我做了 gem install 和 bundle install 之后的错误消息。然后 therubyracer-heroku抛出了一堆错误,所以我查了一下,告诉我我需要将它包装在一个组中,我做了并从 gem 文件中的生产组中删除了。现在当我执行“捆绑安装”时,一切都很好,所以我继续“rails server”,我在下面收到错误消息。有什么帮助吗?请

source 'https://rubygems.org'
ruby '1.9.3'

gem 'rails', '3.2.13'

gem 'pg'
gem 'hashie'
gem 'figaro' # handles app configurations
gem 'airbrake' # exception/error tracking service
gem 'haml'
gem 'validates_existence', '>= 0.4'
gem 'useragent'
gem 'heroku'

group :development do
    gem 'zeus' # speeds up loading of console and server
    gem 'better_errors' # nicely-formatted UI of errors
    gem 'binding_of_caller' # allows real-time debugging on error breakpoints
    gem 'therubyracer', :platforms => :ruby, :require => 'v8'
end

group :production do

end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
end

gem 'sass-rails',   '~> 3.2.5'
gem 'coffee-rails', '~> 3.2.2'
gem 'uglifier'
gem 'jquery-rails'
gem 'prototype-rails'
gem 'coffee-filter'

- 错误输出

    Rails 3.2.13
    ruby 1.9.3p429 (2013-05-15) [i386-mingw32]

    $ rails server
    c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
    tive_support/dependencies.rb:251:in `require': cannot load such file -- pty (LoadError)

    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/zeus-0.13.3/lib/zeus.rb:4:in `<top (required)>'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
    from c:/Sites/rct/config/application.rb:7:in `<top (required)>'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:53:in `require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:53:in `block in <top (required)>'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
4

1 回答 1

0

gem 需要 Linux或zeusMac OS X 见https://github.com/burke/zeus

从 Gemfile 中删除 zeus gem,运行bundle install,然后重试rails server

于 2013-07-31T18:49:16.627 回答