Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't proceed after bundler install #2401

Closed
icemagno opened this issue Oct 17, 2019 · 17 comments
Closed

Can't proceed after bundler install #2401

icemagno opened this issue Oct 17, 2019 · 17 comments

Comments

@icemagno
Copy link

I can't go further after
cd openstreetmap-website
bundle install

root@36022329ca97:/home/openstreetmap-website# bundle install
Traceback (most recent call last):
        1: from /usr/local/bin/bundle:23:in `<main>'
/usr/local/bin/bundle:23:in `load': cannot load such file -- /usr/share/rubygems-integration/all/gems/bundler-1.16.1/exe/bundle (LoadError)

I'm trying to create a Docker image from the install procedure.

@mmd-osm
Copy link
Contributor

mmd-osm commented Oct 17, 2019

You may try #2272 instead of creating your own Docker image.

@tomhughes
Copy link
Member

Other than that it appears your bundler install is broken but you've provided no details of how you installed that or even what instructions you are following, what your platform us, or anything else.

I'm not even sure how @mmd-osm has concluded that you're using docker...

@mmd-osm
Copy link
Contributor

mmd-osm commented Oct 17, 2019

It’s that root@36022329ca97 in the prompt, and the op wrote he’s working on a Docker image.

@icemagno
Copy link
Author

icemagno commented Oct 17, 2019

@tomhughes ... good Lord. I WROTE it. Can you READ the entire text?

By the way... Can't find the Dockerfile in the code. I'm in a cellphone now and may be a little blinded. Can you show me where to go to find it?

@tomhughes
Copy link
Member

Well if you don't want my help then fine. I'll sign off from this ticket. Good luck.

@mmd-osm
Copy link
Contributor

mmd-osm commented Oct 17, 2019

It's a Pull Request, which means the Dockerfile is not yet in the master branch. It still needs to be merged.

See https://github.com/fazlerabbi37/openstreetmap-website/tree/docker

@icemagno
Copy link
Author

Many thanks. Consider this as solved. You can close.

@icemagno icemagno reopened this Oct 27, 2019
@icemagno
Copy link
Author

@mmd-osm after follow the instructions from https://github.com/fazlerabbi37/openstreetmap-website/tree/docker I have now a database container running and an image from the website but I cant put the website container to run.

Actualy I do not ran the docker compose file. Just build the two steps (database and website) one after other. I can put the database to run and can access it from outside Docker.

I can build the website image but I can't run it because when I try to run bundle exec rails s -p 3000 -b '0.0.0.0' I got the help for bundle exec new:

Usage:
  rails new APP_PATH [options]

Options:
      [--skip-namespace], [--no-skip-namespace]            # Skip namespace (affects only isolated applications)
  -r, [--ruby=PATH]                                        # Path to the Ruby binary of your choice
                                                           # Default: /usr/local/bin/ruby
  -m, [--template=TEMPLATE]                                # Path to some application template (can be a filesystem path or URL)
  -d, [--database=DATABASE]                                # Preconfigure for selected database (options: mysql/postgresql/sqlite3/oracle/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
                                                           # Default: sqlite3
      [--skip-yarn], [--no-skip-yarn]                      # Don't use Yarn for managing JavaScript dependencies
      [--skip-gemfile], [--no-skip-gemfile]                # Don't create a Gemfile
  -G, [--skip-git], [--no-skip-git]                        # Skip .gitignore file
      [--skip-keeps], [--no-skip-keeps]                    # Skip source control .keep files
  -M, [--skip-action-mailer], [--no-skip-action-mailer]    # Skip Action Mailer files
  -O, [--skip-active-record], [--no-skip-active-record]    # Skip Active Record files
      [--skip-active-storage], [--no-skip-active-storage]  # Skip Active Storage files
  -P, [--skip-puma], [--no-skip-puma]                      # Skip Puma related files
  -C, [--skip-action-cable], [--no-skip-action-cable]      # Skip Action Cable files
  -S, [--skip-sprockets], [--no-skip-sprockets]            # Skip Sprockets files
      [--skip-spring], [--no-skip-spring]                  # Don't install Spring application preloader
      [--skip-listen], [--no-skip-listen]                  # Don't generate configuration that depends on the listen gem
      [--skip-coffee], [--no-skip-coffee]                  # Don't use CoffeeScript
  -J, [--skip-javascript], [--no-skip-javascript]          # Skip JavaScript files
      [--skip-turbolinks], [--no-skip-turbolinks]          # Skip turbolinks gem
  -T, [--skip-test], [--no-skip-test]                      # Skip test files
      [--skip-system-test], [--no-skip-system-test]        # Skip system test files
      [--skip-bootsnap], [--no-skip-bootsnap]              # Skip bootsnap gem
      [--dev], [--no-dev]                                  # Setup the application with Gemfile pointing to your Rails checkout
      [--edge], [--no-edge]                                # Setup the application with Gemfile pointing to Rails repository
      [--rc=RC]                                            # Path to file containing extra configuration options for rails command
      [--no-rc], [--no-no-rc]                              # Skip loading of extra configuration options from .railsrc file
      [--api], [--no-api]                                  # Preconfigure smaller stack for API only apps
  -B, [--skip-bundle], [--no-skip-bundle]                  # Don't run bundle install
      [--webpack=WEBPACK]                                  # Preconfigure for app-like JavaScript with Webpack (options: react/vue/angular/elm/stimulus)

I got the sane result when I try to run bundle exec rails server

I've noticed I can't run any rake command from the docker container. The error is there is no rake file present.

I know you guys is not responsible to the Docker container but I can't open any issue at https://github.com/fazlerabbi37/openstreetmap-website. I hope you can put some light here because I know nothing about Ruby.

@jalessio
Copy link
Contributor

@icemango please try this branch:
#2409

@icemagno
Copy link
Author

@jalessio thanks. I'll give a try.

@icemagno
Copy link
Author

icemagno commented Oct 28, 2019

@jalessio after try your code I still can't put it to run. This is what I've done:

First step was to figure out how to get the file config/docker.database.yml because this command is not getting it to my local host: git clone https://github.com/openstreetmap/openstreetmap-website.git.

My first thought was to change the repository from openstreetmap to jalessio and try to take the docker-compose-take2.

After all I need to download it using the option Clone or Download | Download ZIP from GitHub and then copy it to my Docker host.

Now I can proceed the the steps described here: https://github.com/jalessio/openstreetmap-website/blob/docker-compose-take2/DOCKER.md.

I follow the tutorial until here: docker-compose run --rm web rake yarn:install and then try to access the web container at port 3000.

This is what I get:
500 Internal Server Error If you are the administrator of this website, then please read this web application's log file and/or the web server's log file to find out what went wrong.

This is the log found in my Portainer from the web container:

Puma starting in single mode...
* Version 3.12.1 (ruby 2.5.7-p206), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
Started GET "/" for 192.168.0.5 at 2019-10-28 01:35:13 +0000
   (0.8ms)  SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
   /usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/log_subscriber.rb:98
Processing by SiteController#index as HTML
  Rendering site/index.html.erb within layouts/map
  Rendered site/index.html.erb within layouts/map (1.1ms)
Completed 500 Internal Server Error in 16087ms (ActiveRecord: 0.0ms)

ActionView::Template::Error (Error: Invalid CSS after ".": expected 1 selector or at-rule, was "../common.scss"
        on line 1:1 of app/assets/stylesheets/ltr/common.scss
>> ../common.scss
   ^
):

Processing by ErrorsController#internal_server_error as HTML
  Rendering errors/internal_server_error.html.erb within layouts/error
  Rendered errors/internal_server_error.html.erb within layouts/error (0.4ms)
Completed 500 Internal Server Error in 600ms (ActiveRecord: 0.0ms)
Error during failsafe response: Error: Invalid CSS after ".": expected 1 selector or at-rule, was "../common.scss"
        on line 1:1 of app/assets/stylesheets/ltr/common.scss
>> ../common.scss
   ^

May I miss something?

@jalessio
Copy link
Contributor

@icemagno here's my recommended way of using my branch, starting all the way from the beginning:

git clone https://github.com/openstreetmap/openstreetmap-website.git
cd openstreetmap-website
git remote add jalessio https://github.com/jalessio/openstreetmap-website.git
git fetch jalessio

You now have two git "remotes", one called "origin" and one called "jalessio". You can see this for yourself by running this:

git remote -v

which will output something like this (or more likely exactly this)

jalessio    https://github.com/jalessio/openstreetmap-website.git (fetch)
jalessio    https://github.com/jalessio/openstreetmap-website.git (push)
origin  https://github.com/openstreetmap/openstreetmap-website.git (fetch)
origin  https://github.com/openstreetmap/openstreetmap-website.git (push)

You can now switch to my work-in-progress docker-compose-take2 branch:

git checkout jalessio/docker-compose-take2

From there, you should read the updated DOCKER.md file and follow the instructions there. From the error you posted my guess is that you did not run the database migrations via this command:

docker-compose run --rm web rake db:migrate

@icemagno
Copy link
Author

As a suggestion I would like to say something: First, I have some needs regarding names, networks and ports so the default names like "openstreetmap_web_1" is not a good idea to keep in my infrastructure.

Can you show how to force containers names, published ports, volumes and attached networks?

@jalessio
Copy link
Contributor

@icemango all of these things are configured via the docker-compose.yml file. Docs @ https://docs.docker.com/compose/

At this point we’ve drifted pretty far from the original issue and we’re discussing the use of as-of-yet un-merged code. I think we’d do better to close this issue and discuss things specific to Docker Compose over in PR #2409.

@icemagno
Copy link
Author

@jalessio many thanks for your help and for your patience. I'll try it ASAP and put the results here.

@icemagno
Copy link
Author

icemagno commented Oct 29, 2019

Ok, returning to the original issue, I'm sure I do the docker-compose run --rm web rake db:migrate command. I can see a lot of SQL commands running without error.

I can say that because I actualy forgot to do this at my first try and the website complains about this with a very red persuasive screen. The error I'm talking about came after the database migration. I stop to follow the instructions just before the "test" stuff ( I ran the Node.js install ).

Note: I'm typing this BEFORE testing your new instructions. Just FYI.

@mmd-osm
Copy link
Contributor

mmd-osm commented Nov 2, 2019

@icemagno : is there anything left to do in this issue? If not, can you please close it?

@icemagno icemagno closed this as completed Nov 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants