Rails App - Server is not working to show preview

rails
preview
ruby
database

#1

This is my first time using Cloud 9. I cloned a specific project in github followed then by these steps.

  1. Bundle Install
  2. rake db:migrate
  3. rails s

After doing that I went to tcp://localhost:8080 but got hit with this error “tcp’s server DNS address could not be found”

I have provided my gem file below and my database.yml. Thank you so much guys :smile:
Database.yml

default: &default
  adapter: sqlite3
  pool: 5
  timeout: 5000

development:
  <<: *default
  database: db/development.sqlite3

test:
  <<: *default
  database: db/test.sqlite3

production:
  <<: *default
  database: db/production.sqlite3

Gemfile

gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
gem 'sqlite3'
gem 'puma', '~> 3.0'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'jquery-rails'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'bootstrap-sass', '~> 3.3', '>= 3.3.7'
gem 'devise', '~> 4.2'
gem 'omniauth-facebook', '~> 4.0'
gem 'paperclip', '~> 5.1'
gem 'redis'
gem "font-awesome-rails"
gem 'chosen-rails'
gem 'devise-bootstrap-views', '~> 0.0.9'
gem 'pry', '~> 0.10.4'
gem 'bootstrap-modal-rails', '~> 2.2', '>= 2.2.5'
gem 'better_errors', '~> 2.1', '>= 2.1.1'







group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platform: :mri
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console'
  gem 'listen', '~> 3.0.5'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

#2

Please try going to your Cloud9 specific URL (localhost refers to the computer you’re on, not Cloud9). The URL is in the format workspacename-username.c9users.io.


#3

@dannytech Actually figured out the issue partially it was what you said :smile: if anyone faces this you should do the following

  1. $ rails server -b $IP -p $PORT
  2. Run Project (opens command line Terminal) and click run

You should be good :slight_smile: