0

This is my first time learning to code, first time on Linux and first time on stackeroverflow so I dont know if its glaringly obvious where I have gone wrong.

I have followed this guide https://gorails.com/setup/ubuntu/16.04 and everything was working as the guide said until I got to this section:

run bundle install --local /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- bundler (LoadError) from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /usr/lib/ruby/vendor_ruby/rails/generators/app_base.rb:328:in bundle_command' from /usr/lib/ruby/vendor_ruby/rails/generators/app_base.rb:344:inrun_bundle' from (eval):1:in run_bundle' from /usr/lib/ruby/vendor_ruby/thor/command.rb:27:inrun' from /usr/lib/ruby/vendor_ruby/thor/invocation.rb:126:in invoke_command' from /usr/lib/ruby/vendor_ruby/thor/invocation.rb:133:inblock in invoke_all' from /usr/lib/ruby/vendor_ruby/thor/invocation.rb:133:in each' from /usr/lib/ruby/vendor_ruby/thor/invocation.rb:133:inmap' from /usr/lib/ruby/vendor_ruby/thor/invocation.rb:133:in invoke_all' from /usr/lib/ruby/vendor_ruby/thor/group.rb:232:indispatch' from /usr/lib/ruby/vendor_ruby/thor/base.rb:440:in start' from /usr/lib/ruby/vendor_ruby/rails/commands/application.rb:17:in' from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /usr/lib/ruby/vendor_ruby/rails/cli.rb:14:in <top (required)>' from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/bin/rails:9:in' tom@Laptop:~$ cd myapp tom@Laptop:~/myapp$ rake db:create rake aborted! LoadError: cannot load such file -- bundler/setup /home/tom/myapp/config/boot.rb:3:in <top (required)>' /home/tom/myapp/config/application.rb:1:in' /home/tom/myapp/Rakefile:4:in <top (required)>' (See full trace by running task with --trace) tom@Laptop:~/myapp$ rails server /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire': cannot load such file -- bundler/setup (LoadError) from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from /home/tom/myapp/config/boot.rb:3:in' from bin/rails:3:in require_relative' from bin/rails:3:in'

Sorry I don't know how to format this correctly. When I visit localhost:3000 I just get Network error.

Has anyone got any idea how to solve this? Thanks for your time.

1 Answers1

0

Try gem install bundler. After that use bundle install in terminal.

Uday kumar das
  • 1,615
  • 16
  • 33
  • I used sudo gem install then the bundle install gives me this error: 'code'Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /tmp/bundler20161105-11803-1jw9vv3debug_inspector-0.0.2/gems/debug_inspector-0.0.2/ext/debug_inspector /usr/bin/ruby2.3 -r ./siteconf20161105-11803-14wcuhn.rb extconf.rb mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h extconf failed, exit code 1 An error occurred while installing debug_inspector (0.0.2), and Bundler cannot continue. – Tom Armstrong Nov 05 '16 at 09:49
  • and it gave me this: Make sure that `gem install debug_inspector -v '0.0.2'` succeeds before bundling. So i did sudo gem install debug_inspector -v '0.0.2' and tried it again and it still gave the same error – Tom Armstrong Nov 05 '16 at 09:52
  • Put `gem install debug_inspector` in gemfile. Delete `gemfile.lock` and then try `bundle install` in terminal again. – Uday kumar das Nov 05 '16 at 09:57
  • where would gemfile.lock be located? – Tom Armstrong Nov 05 '16 at 10:16
  • In your App directory. Look at the last files in your app. – Uday kumar das Nov 05 '16 at 10:22
  • @TomArmstrong see http://stackoverflow.com/questions/20559255/error-while-installing-json-gem-mkmf-rb-cant-find-header-files-for-ruby, you need to install a ruby-dev package. In this case if you googled `can't find header files for ruby ` you would have found a solution. – max pleaner Nov 05 '16 at 20:17