简体   繁体   中英

I cannot execute rails console

I am getting an error I have no clue how to fix it.

$ rails console
/Users/liviu-mac/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- bundler/setup (LoadError)
    from /Users/liviu-mac/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/liviu-mac/rails_projects/instrumon/vendor/bundle/gems/spring-1.6.1/lib/spring/commands.rb:33:in `<module:Spring>'
    from /Users/liviu-mac/rails_projects/instrumon/vendor/bundle/gems/spring-1.6.1/lib/spring/commands.rb:4:in `<top (required)>'
    from /Users/liviu-mac/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/liviu-mac/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/liviu-mac/rails_projects/instrumon/vendor/bundle/gems/spring-1.6.1/lib/spring/application.rb:77:in `preload'
    from /Users/liviu-mac/rails_projects/instrumon/vendor/bundle/gems/spring-1.6.1/lib/spring/application.rb:143:in `serve'
    from /Users/liviu-mac/rails_projects/instrumon/vendor/bundle/gems/spring-1.6.1/lib/spring/application.rb:131:in `block in run'
    from /Users/liviu-mac/rails_projects/instrumon/vendor/bundle/gems/spring-1.6.1/lib/spring/application.rb:125:in `loop'
    from /Users/liviu-mac/rails_projects/instrumon/vendor/bundle/gems/spring-1.6.1/lib/spring/application.rb:125:in `run'
    from /Users/liviu-mac/rails_projects/instrumon/vendor/bundle/gems/spring-1.6.1/lib/spring/application/boot.rb:18:in `<top (required)>'
    from /Users/liviu-mac/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/liviu-mac/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from -e:1:in `<main>'


$ ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]

$ rails -v
Rails 4.2.5

$ rvm current
ruby-2.2.3

$ irb
2.3.0 :001 > 

I am able to start the server with rails s and the app is working. I am able to deploy on Heroku and I can execute rails dbconsole .

  1. Downgraded bundler from 1.11.x to 1.10.2
  2. Removed the folder .bundler from ~ and any main folder of all rails projects (several)
  3. Executed from the main folder of any rails project the command: bundle install --system

Problem solved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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