在Windows

时间:2016-06-23 04:57:32

标签: ruby-on-rails server

我在尝试运行" rails server"时遇到错误,我正在遵循以下建议:https://www.youtube.com/watch?v=GwaeRJRoCeo

这就是我得到的:

C:\ruby\rails\firstapp>rails server
C:/ruby/lib/ruby/gems/2.1.0/gems/rails-2.1.0/lib/rails_generator/options.rb:32:i
n `default_options': undefined method `write_inheritable_attribute' for Rails::G
enerator::Base:Class (NoMethodError)
        from C:/ruby/lib/ruby/gems/2.1.0/gems/rails-2.1.0/lib/rails_generator/ba
se.rb:90:in `<class:Base>'
        from C:/ruby/lib/ruby/gems/2.1.0/gems/rails-2.1.0/lib/rails_generator/ba
se.rb:85:in `<module:Generator>'
        from C:/ruby/lib/ruby/gems/2.1.0/gems/rails-2.1.0/lib/rails_generator/ba
se.rb:48:in `<module:Rails>'
        from C:/ruby/lib/ruby/gems/2.1.0/gems/rails-2.1.0/lib/rails_generator/ba
se.rb:6:in `<top (required)>'
        from C:/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:126:in `
require'
        from C:/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:126:in `
require'
        from C:/ruby/lib/ruby/gems/2.1.0/gems/rails-2.1.0/lib/rails_generator.rb
:34:in `<top (required)>'
        from C:/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:126:in `
require'
        from C:/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:126:in `
require'
        from C:/ruby/lib/ruby/gems/2.1.0/gems/rails-2.1.0/bin/rails:13:in `<top
(required)>'
        from C:/ruby/bin/rails:23:in `load'
        from C:/ruby/bin/rails:23:in `<main>'

我试着改变 在config / environments / development.rb中:

firstapp::Application.configure do 

仍有错误

2 个答案:

答案 0 :(得分:0)

上次,我遇到了和你一样的问题。你可以这样做来解决它。

gem uninstall rmagick 
gem cleanup 
bundle install

它对我有用。你可以尝试一下。

答案 1 :(得分:0)

我得到了答案,在Windows中,我可以在3000端口运行 现在我尝试使用它:

rails server -p 80

它的工作