简体   繁体   English

Rails 4.2和gem配置坏了

[英]Rails 4.2 and gem config broken

My OS X ruby dev environment is broken, I don't know why. 我的OS X ruby​​开发环境坏了,我不知道为什么。 I undesrtood that the gem path is wrong, but I don't know how to fix it. 我不喜欢宝石路径是错误的,但我不知道如何解决它。

/Users/muqaddar/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'rails' (>= 0) among 14 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/Users/muqaddar/.rvm/gems/ruby-2.0.0-p598:/Users/muqaddar/.rvm/gems/ruby-2.0.0-p598@global', execute `gem env` for more information
    from /Users/muqaddar/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:324:in `to_spec'
    from /Users/muqaddar/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:64:in `gem'
    from /usr/bin/rails:22:in `<main>'

Here is my config with gem env: 这是我的gem env配置:

RubyGems Environment:
  - RUBYGEMS VERSION: 2.4.6
  - RUBY VERSION: 2.0.0 (2014-11-13 patchlevel 598) [x86_64-darwin14.1.0]
  - INSTALLATION DIRECTORY: /Users/muqaddar/.rvm/gems/ruby-2.0.0-p598
  - RUBY EXECUTABLE: /Users/muqaddar/.rvm/rubies/ruby-2.0.0-p598/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/muqaddar/.rvm/gems/ruby-2.0.0-p598/bin
  - SPEC CACHE DIRECTORY: /Users/muqaddar/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /Users/muqaddar/.rvm/rubies/ruby-2.0.0-p598/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-14
  - GEM PATHS:
     - /Users/muqaddar/.rvm/gems/ruby-2.0.0-p598
     - /Users/muqaddar/.rvm/gems/ruby-2.0.0-p598@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /Users/muqaddar/.rvm/gems/ruby-2.0.0-p598/bin
     - /Users/muqaddar/.rvm/gems/ruby-2.0.0-p598@global/bin
     - /Users/muqaddar/.rvm/rubies/ruby-2.0.0-p598/bin
     - /usr/local/mysql/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /opt/X11/bin
     - /Users/muqaddar/.rvm/bin

I tried many things, reading lots of threads. 我尝试了很多东西,阅读了很多线程。 - reinstall rvm - remove .vendor/bundle - bundle install ...etc - 重新安装rvm - 删除.vendor / bundle - bundle install ...等

I think the gems are not installed in the right directory. 我认为宝石没有安装在正确的目录中。 How to change that depending my rvm config ? 如何根据我的rvm配置更改它?

You should try and follow these steps if you are using a mac: http://www.installrails.com/ 如果您使用的是mac, 尝试按以下步骤操作: http//www.installrails.com/

Note that when installing a new gem, you first have to add it to the Gemfile inside your editor. 请注意,在安装新gem时,首先必须将其添加到编辑器中的Gemfile中。 For example: gem 'bootstrap-sass', '~> 3.3.3' After doing this navigate to your folder using terminal and type: "bundle install". 例如:gem'bootstrap-sass','〜> 3.3.3'执行此操作后,使用终端导航到您的文件夹并输入:“bundle install”。 This will install your added gems. 这将安装您添加的宝石。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM