mac上的命令行“rails server”出错

时间:2014-02-23 04:02:47

标签: ruby-on-rails ruby-on-rails-3 ruby-on-rails-3.2 ruby-on-rails-3.1

每当我在mac终端中使用“rails server”命令时,它都会提示错误:

/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- rubygems/format (LoadError)
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.0.22/lib/bundler/source.rb:5:in `<top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.0.22/lib/bundler/dsl.rb:14:in `initialize'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.0.22/lib/bundler/dsl.rb:6:in `new'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.0.22/lib/bundler/dsl.rb:6:in `evaluate'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.0.22/lib/bundler/definition.rb:17:in `build'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.0.22/lib/bundler.rb:138:in `definition'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.0.22/lib/bundler.rb:126:in `load'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.0.22/lib/bundler.rb:110:in `setup'
    from /Users/martindureja/Desktop/rails_projects/first_app/config/boot.rb:8:in `<top (required)>'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from script/rails:5:in `<main>'

1 个答案:

答案 0 :(得分:1)

在尝试安装宝石时,您似乎遇到了权限错误。如果您以后不想担心这一点,请使用RVM。

https://rvm.io/