【发布时间】:2016-07-13 13:32:12
【问题描述】:
我正在尝试启动 Rails 服务器,但出现错误:
/Users/<username>/RubyWorkspace/<appname>/vendor/bundle/gems/railties-5.0.0/lib/rails/commands/rake_proxy.rb:2:in `require': cannot load such file -- active_support (LoadError)
当我转到 /vendor/bundle 并列出 gem 时,我没有看到积极的支持:
actioncable-5.0.0 minitest-5.9.0
actionmailer-5.0.0 multi_json-1.12.1
actionpack-5.0.0 nio4r-1.2.1
actionview-5.0.0 pkg-config-1.1.7
activejob-5.0.0 rack-2.0.1
activemodel-5.0.0 rack-test-0.6.3
activerecord-5.0.0 rails-5.0.0
arel-7.0.0 rails-dom-testing-2.0.1
builder-3.2.2 rails-html-sanitizer-1.0.3
byebug-9.0.0 railties-5.0.0
byebug-9.0.5 rake-11.2.2
coffee-rails-4.2.1 rb-fsevent-0.9.7
coffee-script-2.4.1 rb-inotify-0.9.7
coffee-script-source-1.10.0 sass-3.4.22
concurrent-ruby-1.0.2 sass-rails-5.0.5
debug_inspector-0.0.2 spring-1.7.1
erubis-2.7.0 spring-1.7.2
execjs-2.7.0 spring-watcher-listen-2.0.0
ffi-1.9.14 sprockets-3.6.3
globalid-0.3.6 sprockets-rails-3.1.1
i18n-0.7.0 thor-0.19.1
jbuilder-2.4.1 thread_safe-0.3.5
jbuilder-2.5.0 tilt-2.0.5
jquery-rails-4.1.1 turbolinks-5.0.0
listen-3.0.8 turbolinks-source-5.0.0
loofah-2.0.3 tzinfo-1.2.2
mail-2.6.4 uglifier-3.0.0
method_source-0.8.2 web-console-3.1.1
mime-types-3.1 web-console-3.3.1
mime-types-data-3.2016.0521 websocket-driver-0.6.4
mini_portile2-2.1.0 websocket-extensions-0.1.2
但是当我运行 bundle update 时,bundler 说它正在使用主动支持:
Using rake 11.2.2
....
Using activesupport 5.0.0
....
Bundle updated!
Gems in the group production were not installed.
我认为可能导致错误但我不确定的一件事是,当我在 gem 路径下运行 gem env 时,它显示:
- GEM PATHS:
- /Users/<username>/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0
- /Users/<username>/.gem/ruby/2.3.0
我是否需要修复 gem 路径,是否需要在不同的目录中重新安装活动支持,还是完全不同?
【问题讨论】:
-
您是否使用捆绑程序运行服务器,即
bundle exec rails s? -
我不是,但我试过了,同样的错误出现了
-
如果是 rails 项目,必须有 Gemfile 并且你应该运行
bundle install来安装所有的 gem。你做到了吗? -
是的,我最近这样做了
标签: ruby-on-rails ruby terminal activesupport