Search code examples
ruby-on-railsrubyubuntucloud9-ide

Errno::ENOENT when trying to start rails server on cloud 9


When running the command shown in the code block below I get the following error shown also

 theoneinskane:~/workspace/toy_app $ rails server -b $IP -p $PORT
/usr/local/rvm/gems/ruby-2.2.1@global/gems/rubygems-bundler-1.4.4/lib/rubygems-bundler/noexec.rb:5:in `pwd': No such file or directory - getcwd (Errno::ENOENT)
        from /usr/local/rvm/gems/ruby-2.2.1@global/gems/rubygems-bundler-1.4.4/lib/rubygems-bundler/noexec.rb:5:in `<class:Noexec>'
        from /usr/local/rvm/gems/ruby-2.2.1@global/gems/rubygems-bundler-1.4.4/lib/rubygems-bundler/noexec.rb:3:in `<top (required)>'
        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require'
        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
        from /usr/local/rvm/gems/ruby-2.2.1@global/gems/rubygems-bundler-1.4.4/lib/rubygems_executable_plugin.rb:4:in `block in <top (required)>'
        from /usr/local/rvm/gems/ruby-2.2.1@global/gems/executable-hooks-1.3.2/lib/executable-hooks/hooks.rb:50:in `call'
        from /usr/local/rvm/gems/ruby-2.2.1@global/gems/executable-hooks-1.3.2/lib/executable-hooks/hooks.rb:50:in `block in run'
        from /usr/local/rvm/gems/ruby-2.2.1@global/gems/executable-hooks-1.3.2/lib/executable-hooks/hooks.rb:49:in `each'
        from /usr/local/rvm/gems/ruby-2.2.1@global/gems/executable-hooks-1.3.2/lib/executable-hooks/hooks.rb:49:in `run'
        from /usr/local/rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:10:in `<main>'

I'm running ruby 2.2.1 and rails 4.2.2 and the gem file I loaded looks like this:

    source 'https://rubygems.org'

gem 'rails',                   '4.2.2'
gem 'bcrypt',                  '3.1.7'
gem 'faker',                   '1.4.2'
gem 'carrierwave',             '0.10.0'
gem 'mini_magick',             '3.8.0'
gem 'fog',                     '1.36.0'
gem 'will_paginate',           '3.0.7'
gem 'bootstrap-will_paginate', '0.0.10'
gem 'bootstrap-sass',          '3.2.0.0'
gem 'sass-rails',              '5.0.2'
gem 'uglifier',                '2.5.3'
gem 'coffee-rails',            '4.1.0'
gem 'jquery-rails',            '4.0.3'
gem 'turbolinks',              '2.3.0'
gem 'jbuilder',                '2.2.3'
gem 'sdoc',                    '0.4.0', group: :doc

group :development, :test do
  gem 'sqlite3',     '1.3.9'
  gem 'byebug',      '3.4.0'
  gem 'web-console', '2.0.0.beta3'
  gem 'spring',      '1.1.3'
end

group :test do
  gem 'minitest-reporters', '1.0.5'
  gem 'mini_backtrace',     '0.1.3'
  gem 'guard-minitest',     '2.3.1'
end

group :production do
  gem 'pg',             '0.17.1'
  gem 'rails_12factor', '0.0.2'
  gem 'puma',           '2.11.1'
end

Despite searching extensively I cannot seem to figure out what is going wrong. As you can tell I am running a tutorial but cannot find much help. I have done exactly the same steps before with 2 previous small apps with no negative results. Any help with this would be greatly appreciated. I am sure it is something very simple that I am missing


Solution

  • I just solved this actually. But perhaps the answer may help others. Despite searching around I had not tried one very basic thing which was to close down the terminal window in the Cloud 9 IDE and then open a fresh window and start the rails server. Doing this and the error message no longer appeared