Docker Compose Could not locate Gemfile or .bundle/ directory - ruby-on-rails

When I run docker-compose up -d I get the following error:
web_1 | Could not locate Gemfile or .bundle/ directory
However the image is being created. I want to have a Rails application, and for the Docker files to live outside the rails application. I have the following Dockerfile
FROM ruby:2.5
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
WORKDIR /app
COPY ./app/Gemfile Gemfile
# Install Gems
RUN bundle install
ADD . /app
In the docker-compose.yml file I have the Following configuration:
version: '3'
services:
db:
image: postgres:9.6.1 # To Edit - Default is postgresql.
web:
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0'
volumes:
- .:/app
ports:
- "3000:3000"
depends_on:
- db
And for the Gemfile I have the following code:
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.5.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.0'
# Use postgresql as the database for Active Record
gem 'pg'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# 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
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15', '< 4.0'
gem 'selenium-webdriver'
# Easy installation and use of chromedriver to run system tests with Chrome
gem 'chromedriver-helper'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
I'm not sure if it has something to do with the Rails or Ruby version. I also see that the Gemfile is there once I go into the container and run ls so is not that theres no Gemfile.
root#ab38d643df47:/app# ls
Dockerfile Gemfile Gemfile.lock README.md app docker-compose.yml

try this:
FROM ruby:2.5
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
WORKDIR app
COPY Gemfile Gemfile
# Install Gems
RUN bundle install
ADD . app

Related

Bundle install fails only in CircleCI(mysql2)

Want to achieve
Thank you for browsing.
I got the following error when using "bundle install" to build with CircleCI.
In my environment, I can install the bundle without any problems.
I hope you can tell me how to solve this problem.
error
To see why this extension failed to compile, please check the mkmf.log which can
be found here:
/home/circleci/myapp/web/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0-static/mysql2-0.5.2/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in
/home/circleci/myapp/web/vendor/bundle/ruby/2.6.0/gems/mysql2-0.5.2 for
inspection.
Results logged to
/home/circleci/myapp/web/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0-static/mysql2-0.5.2/gem_make.out
An error occurred while installing mysql2 (0.5.2), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/'`
succeeds before bundling.
In Gemfile:
mysql2
Exited with code exit status 5
CircleCI received exit code 5
Codes
.circleci/config.yml
version: 2.1
orbs:
ruby: circleci/ruby#1.1.2
jobs:
build:
docker:
- image: cimg/ruby:2.6.5
working_directory: ~/myapp/web
steps:
- checkout:
path: ~/myapp
- ruby/install-deps
workflows:
version: 2
build_and_test:
jobs:
- build
Gemfile
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.6.5'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.3', '>= 6.0.3.7'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.4.4'
# Use Puma as the app server
gem 'puma', '~> 4.1'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 4.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Active Storage variant
# gem 'image_processing', '~> 1.2'
# jQuery
gem "jquery-rails"
gem 'rails-i18n', '~> 6'
gem "enum_help"
gem "config"
gem 'faraday'
gem 'acts_as_paranoid', '~> 0.6.0'
gem 'http-cookie'
gem 'kaminari'
gem 'devise'
gem 'devise_token_auth'
gem 'devise-security'
gem 'devise-two-factor', '~> 3.1'
# AWS
gem 'aws-sdk'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false
gem 'composite_primary_keys'
# Antivirus
gem 'clamav-client', require: 'clamav/client'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# 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
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
# Easy installation and use of web drivers to run system tests with browsers
gem 'webdrivers'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
I tried
Mention to run gem install mysql2 -v before ruby/install-deps
- run:
name: Install mysql2
command: gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/'
- ruby/install-deps
↓
build
↓
Another error occurred.
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/home/circleci/.rubygems/extensions/x86_64-linux/2.6.0-static/mysql2-0.5.2/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /home/circleci/.rubygems/gems/mysql2-0.5.2 for inspection.
Results logged to /home/circleci/.rubygems/extensions/x86_64-linux/2.6.0-static/mysql2-0.5.2/gem_make.out
Exited with code exit status 1
CircleCI received exit code 1
I modified the config.yml as follows and was able to build
steps:
- checkout:
path: ~/myapp
- run:
name: default mysql client install
command: |
sudo apt update
sudo apt-get install default-mysql-client
sudo apt-get install libmysqlclient-dev
- run:
name: bundle Install
command: bundle install --path vendor/bundle

ElasticSearch in Docker Compose

Please go easy on me here, My experience with ElasticSearch is pretty much solely with use of SearchKick and my own Rails app.
I have a Rails app which I have been running locally on my machine using SearchKick and ElasticSearch for quite some time now.
Recently I’ve been reading about how to convert my dev environment into a Dockerised form.
I have got my Rails app and its database working nicely but then I came to add Search back in .
My Docker Compose file is below:
version: '3.7'
services:
app:
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0'
volumes:
- .:/app
- bundle-volume:/usr/local/bundle
- yarn-volume:/app/node_modules
ports:
- "3000:3000"
depends_on:
- db
- search
db:
image: 'postgres:9.6'
env_file:
- .env.development
volumes:
- db-volume:/var/lib/postgresql/data
ports:
- "5432:5432"
# environment:
# - POSTGRES_HOST_AUTH_METHOD=trust
search:
image: 'elasticsearch'
env_file:
- .env.development
volumes:
- 'search-volume:/usr/share/elasticsearch/data'
ports:
- '9200:9200'
volumes:
bundle-volume:
yarn-volume:
db-volume:
search-volume:
When I start the container and head to the Rails console to try and run <Model>.reindex I get the following error:
Traceback (most recent call last): 1: from (irb):1
Faraday::ConnectionFailed (Failed to open TCP connection to
localhost:9200 (Cannot assign requested address - connect(2) for
“localhost” port 9200))
I have set an Environment var like so in my .env.development file:
ELASTICSEARCH_URL=http://search:9200
The error shows it’s trying to connect to localhost which is exactly where I think the issue lays.
It doesn’t look like the variable i’m setting in my .env.development file is being used in the way it should be.
Anyone with an in-depth knowledge of Docker able to help me out here?
Thanks,
Neil
EDIT:
Dockerfile:
FROM ruby:2.6.5
# Install 3rd party dependencies.
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt update && \
apt -y install nodejs \
yarn \
build-essential \
libpq-dev
# Sets Environment variables
ENV RAILS_ROOT /app
ENV PORT 3000
# Working directory.
RUN mkdir $RAILS_ROOT
WORKDIR $RAILS_ROOT
# Script run when container first starts.
COPY docker-entrypoint.sh docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh
ENTRYPOINT [ "/app/docker-entrypoint.sh" ]
docker-entrypoint.sh:
#!/bin/bash
set -e
bundle install
yarn install --check-files --frozen-lockfile
# Remove a potentially pre-existing server.pid for Rails.
rm -f /app/tmp/pids/server.pid
# Run the command.
exec "$#"
.env:
ELASTICSEARCH_URL=http://search:9200
DATABASE_HOST=db
DATABASE_USER=postgres
DATABASE_PASSWORD=postgres
DATABASE_NAME=mysite_development
DATABASE_PORT=5432
Gemfile:
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.6.5'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.1.3'
# Use postgresql as the database for Active Record
gem 'pg', '~> 1.2.3'
# Use Puma as the app server
gem 'puma', '~> 4.3.5'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 6.x'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbo-rails', '~> 0.5.11'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
gem 'redis', '~> 4'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Active Storage variant
# gem 'image_processing', '~> 1.2'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false
gem 'devise' # Authorisation and Authentication
gem 'httparty' # Make HTTP requests
gem 'searchkick', '~> 4.5.0' # ElasticSearch searching
gem 'geocoder' # Allows models to have a location
gem 'gretel' #Breadcrumb functionality
gem 'nav_lynx' # Navigation links
gem 'inline_svg', '~> 1.7.2' # Inlines SVG files
gem 'flickraw' # Integration with the Flickr API
gem 'countries', require: 'countries/global' # Country list (with helper to omit ISO3166:: module prefix)
gem 'kaminari' # Pagination
gem 'flutie' # Utility classes
gem 'acts-as-taggable-on', '~> 7.0.0' # Tagging
gem 'friendly_id', '~> 5.4'
gem 'acts_as_list' # Ordering
gem 'delayed_job_active_record' # Background Jobs
gem 'foreman'
gem 'daemons'
gem 'delayed_job_web'
gem 'activerecord-hierarchical_query', '~> 1.3.0'
gem 'roo', '~> 2.8.3'
gem 'faker'
group :development, :test do
gem 'dotenv-rails'
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'rspec-rails'
gem "bullet"
end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '~> 3.4'
# 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.1'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
# Easy installation and use of web drivers to run system tests with browsers
gem 'webdrivers'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'capistrano', '~> 3.11'
gem 'capistrano-rails', '~> 1.4'
gem 'capistrano-passenger', '~> 0.2.0'
gem 'capistrano-rbenv', '~> 2.1', '>= 2.1.4'
gem 'ed25519'
gem 'bcrypt_pbkdf'
gem 'rubocop', require: false
gem 'rubocop-rails', require: false
EDIT 2:
Latest error message:
Traceback (most recent call last): 1: from (irb):1
Faraday::ConnectionFailed (Failed to open TCP connection to
search:9200 (getaddrinfo: No address associated with hostname))
EDIT 3:
So, after getting my machine back today, I tried your suggestions. It turns out the search container was erroring. The error is pasted below:
search_1 | [2021-08-04T20:44:40,178][WARN
][o.e.b.ElasticsearchUncaughtExceptionHandler] [unknown] uncaught
exception in thread [main] search_1 |
org.elasticsearch.bootstrap.StartupException:
ElasticsearchException[java.io.IOException: failed to read [id:7,
file:/usr/share/elasticsearch/data/nodes/0/_state/node-7.st]]; nested:
IOException[failed to read [id:7,
file:/usr/share/elasticsearch/data/nodes/0/_state/node-7.st]]; nested:
XContentParseException[[-1:36] [node_meta_data] unknown field
[node_version], parser not found];
It looks like it's failing due to the location the Volume is set to. I temporarily commented out the Volume configuration for that service and my Rails model now gets indexed.
I'm assuming now though, that if I close the container and start it up again that the Index will have been removed because it's no longer stored in a Volume?
Any ideas how I can get the index data stored in a volume and let the container work?

Don't run Bundler as root - Rails6 on Elastic Beanstalk

I've been trying to deploy a Rails 6 application to Elastic Beanstalk and have been stuck with this Bundle Root error for over a day. I've read through everything I can find but nothing has worked so far.
[ERROR] An error occurred during execution of command [app-deploy] - [stage ruby application]. Stop running the command. Error: install dependencies in Gemfile failed with error Command /bin/sh -c bundle install --local failed with error Command timed out after 900 seconds. Stderr:Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
My gemfile:
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.7.2'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.3', '>= 6.0.3.3'
# Use sqlite3 as the database for Active Record
gem 'pg'
# Use Puma as the app server
gem 'puma', '~> 5.0'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 4.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
gem 'sendgrid-ruby'
gem 'faker'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Active Storage variant
# gem 'image_processing', '~> 1.2'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false
gem 'will_paginate', '~> 3.1.0'
gem 'bootstrap-will_paginate', '1.0.0'
gem 'sprockets', '~> 4.0'
gem 'devise'
gem 'bootstrap'
gem 'jquery-rails'
gem 'figaro'
gem 'rails-controller-testing'
gem 'validates_zipcode'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'minitest'
gem 'minitest-reporters'
end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '~> 3.2'
# 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
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
# Easy installation and use of web drivers to run system tests with browsers
gem 'webdrivers'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', '>= 1.2016.7'
my .ebextension/fix_rails_6.config:
packages:
yum:
git: []
commands:
02_download_nodejs:
command: "curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -"
03_install_nodejs:
command: "yum -y install nodejs"
container_commands:
19_precompile:
command: "bundle exec rake assets:precompile"
And my environment properties:
BUNDLER_DEPLOYMENT_MODE true
BUNDLE_WITHOUT test:development
RACK_ENV production
RAILS_SKIP_ASSET_COMPILATION true
RAILS_SKIP_MIGRATION false
I'm guessing that you have an old, out-of-date Gemfile.lock on the deployed server which has incorrect versions of your Gems listed.
If this builds and runs locally, I would suggest ensuring that you distribute the Gemfile.lock file to your server along with the rest of the code and the Gemfile.
If that doesn't work, remove the Gemfile.lock from your deployed server and try again

Rails command Errors

I was working on a project earlier today when suddenly my rails commands stopped working. I know that I must have introduced something that created an error but for the life of me I don't know what. The error that I get whenever I type any rails commands (for example, rails c, rails s, rails -v etc) is the following:
Traceback (most recent call last):
1: from /Users/mccoleman/.rvm/gems/ruby-2.5.1/bin/rails:23:in `<main>'
/Users/mccoleman/.rvm/gems/ruby-2.5.1/bin/rails:23:in `load': cannot load such file -- /Users/mccoleman/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/exe/rails (LoadError)
The following is my gemfile:
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.5.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.2', '>= 5.2.2.1'
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
# gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false
gem 'rspec'
# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
# gem 'rack-cors'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
gem 'listen', '>= 3.0.5', '< 3.2'
# 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'
gem 'rb-readline'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
I've tried searching for similar errors but haven't been able to find anything that looks similar. Any ideas why rails suddenly isn't working?
Take a look at RVM's gemset. Set a gemset for your project, use it, install and run bundle.
$ cd myproject
$ rvm create gemset mygemset
$ cat 'mygemset' > .ruby-gemset
$ cat 'ruby-2.5.1' > .ruby-version
$ cd .
$ gem install bundle
$ bundle
.ruby-version and .ruby-gemset allow RVM to set your Ruby version and gemset automatically when you cd to you project.
While I'm still not 100% sure what caused the error to occur, I was able to rectify it by uninstalling and then reinstalling rails.

Error with install of ruby on rails in server(vps) ubuntu 16.04

Good day, today I installed ruby on rails on my server, nevertheless there are errors in execution of my app:
rails new testingApp
cd testingApp
rails server
// Appears in my console(Putty) a error.
The error is:
Could not find gem 'puma (~> 3.7)' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.
I do not understand reason of error and I need help regarding this.
I learned to installing Ruby and complements from youtube:
https://youtu.be/ml_-nWq0LEg
The command used for installing there are:
Ruby installation: sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev libsqlite3-dev
Rails installation: sudo gem install rails –v 5.0.0.1
NodeJS installation: sudo apt-get install nodejs
My server have technical requirements:
Ubuntu 16.04.
256 mb of ram.
0.5 Core.
Sorry for my english is very bad.
Thanks for reading of my post and help.
If you project created after putting the command
rails new testingApp
then it is ok but need to install all dependencies
cd testingApp
#=> then run bundler
bundle install
#=> if bundle run properly then run
rails server or rails s
Hope will work
You probably need to install the gem sources listed in Gemfile.
$ cat Gemfile
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.2'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# 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', platforms: [:mri, :mingw, :x64_mingw]
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '~> 2.13'
gem 'selenium-webdriver'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# 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
Please run bundle install --path vendor/bundle to install these gems.
and run bundle exec rails server to start rails on those dependencies.

Resources