I originally tried using bundle install but got the error 'command not found.' I tried
gem install bundler
then tried bundle install, but still got the same error, 'bundle: command not found.'
For reference:
RubyGems Environment:
- RUBYGEMS VERSION: 2.5.1
- RUBY VERSION: 2.3.1 (2016-04-26 patchlevel 112) [x86_64-darwin15]
- INSTALLATION DIRECTORY: /usr/local/opt/gems
- USER INSTALLATION DIRECTORY: /Users/willashley23/.gem/ruby/2.3.0
- RUBY EXECUTABLE: /usr/local/opt/rbenv/versions/2.3.1/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/opt/gems/bin
- SPEC CACHE DIRECTORY: /Users/willashley23/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /usr/local/opt/rbenv/versions/2.3.1/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-15
- GEM PATHS:
- /usr/local/opt/gems
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/opt/rbenv/versions/2.3.1/bin
- /usr/local/Cellar/rbenv/1.0.0/libexec
- /usr/local/opt/rbenv/shims
- /Users/willashley23/.rbenv/bin
- /usr/local/bin
- /usr/local/sbin
- ~/bin
- /Users/willashley23/.rbenv/bin
- /Users/willashley23/.rbenv/shims
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /opt/X11/bin
EDIT ADDED Gemfile:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.6'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
Well I figured out few things according to what you have tried.
1.Install bundler to a global gemset. rvm gemset use global && gem install bundler
2.In case you have Homebrew installed: try brew install ruby
3.If the above solutions don't work the case could be that you are not sourcing rvm correctly, because you are not in a login shell, therefore run
source ~/.rvm/scripts/rvm
and then you can execute bundle install
.
4.Last thing is as you are already using rvm , might be the case that rvm was not selected as default so run
rvm use 2.1.1 --default
and then run bundle install
5.Also you can try rvm get head && rvm reload
before installing bundler.
Let me know if I'm missing something.
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.