Comments (4)
How can I build an api-only app instead of a full rails app?
You sure can! I would recommend you go two different routes.
- Go thru the bootstrap process in full. Then make changes to your app to be API only. What are those changes? Typically a few lines to the application.rb, Gemfile, and the root controller.
- You can make a change as you said to the
bin/_rails-new
file by adding--api
. Then do abin/build
and commit that to your own fork/branch. I did just that and made a pull request with the change so technically you can use this branch too. Hope that outlines the process or the manual files you have to change if #1 is what you choose.
but got errors in aws about the gems not being found after deployment. So I'm not sure what is the best way to proceed
I think above will help but if needed you must share the errors. Cant help unless I know what they are. Cheers!
from lamby-cookiecutter.
Thanks for your reply.
I just ran through a new install following the steps in the readme (trying to just get something working and try to do precisely what you mentioned). However, with the "clean" install I get these errors:
2020-10-22T17:38:57.599-06:00 | Init error when loading handler app.handler |
---|---|
2020-10-22T17:38:57.599-06:00Copy{ "errorMessage": "Could not find public_suffix-4.0.6 in any of the sources", "errorType": "InitBundler::GemNotFound", "stackTrace": [ "/var/runtime/gems/bundler-2.1.4/lib/bundler/spec_set.rb:86:in block in materialize'", "/var/runtime/gems/bundler-2.1.4/lib/bundler/spec_set.rb:80:in map!'", "/var/runtime/gems/bundler-2.1.4/lib/bundler/spec_set.rb:80:in materialize'", "/var/runtime/gems/bundler-2.1.4/lib/bundler/definition.rb:170:in specs'", "/var/runtime/gems/bundler-2.1.4/lib/bundler/definition.rb:237:in specs_for'", "/var/runtime/gems/bundler-2.1.4/lib/bundler/definition.rb:226:in requested_specs'", "/var/runtime/gems/bundler-2.1.4/lib/bundler/runtime.rb:101:in block in definition_method'", "/var/runtime/gems/bundler-2.1.4/lib/bundler/runtime.rb:20:in setup'", "/var/runtime/gems/bundler-2.1.4/lib/bundler.rb:149:in setup'", "/var/runtime/gems/bundler-2.1.4/lib/bundler/setup.rb:20:in block in <top (required)>'", "/var/runtime/gems/bundler-2.1.4/lib/bundler/ui/shell.rb:136:in with_level'", "/var/runtime/gems/bundler-2.1.4/lib/bundler/ui/shell.rb:88:in silence'", "/var/runtime/gems/bundler-2.1.4/lib/bundler/setup.rb:20:in <top (required)>'", "/var/lang/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in require'", "/var/lang/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in require'", "/var/task/config/boot.rb:3:in <top (required)>'", "/var/task/app.rb:2:in require_relative'", "/var/task/app.rb:2:in <top (required)>'", "/var/lang/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in require'", "/var/lang/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in require'" ] } |
It seems to me it that for some reason it is trying to load the "dev" dependencies instead of the prod-only ones.
Have you encountered anything like this before? I feel it might just be a bad config somewhere.
from lamby-cookiecutter.
Interesting. It seems I get those errors when I use a container I built with the "newer" sam that is installed through "brew". Using your docker-compose and docker setup seems to get past those errors. However, I get an error about Missing `secret_key_base` for 'production' environment,...
eventhough the master.key file is there, and the key is registered in SSM.
from lamby-cookiecutter.
Well, when you deploy to production the config/master.key
should not be in the deployed package (https://github.com/customink/lamby-cookiecutter/blob/master/%7B%7Bcookiecutter.project_name%7D%7D/bin/build-rails#L46) it should be written to the .env.production
file in the package (see line 19-24) further up from that same link. You could download the package from S3, change the suffix to .gz and check to make sure. Likewise to confirm that bin/deploy is doing as expected you can run ./bin/run bash
and that the aws ssm get-parameter ...
on Line 19 works as expected. Another method is to check the build artifact directory in .aws-sam director.
from lamby-cookiecutter.
Related Issues (20)
- It looks like you're trying to use Nokogiri as a precompiled native gem on a system with glibc < 2.17 HOT 4
- Cookiecutter setup script fails with command not available error message HOT 5
- RailsLambda may not have authorization defined. HOT 2
- ./bin/build is missing in the generated folder – The instructions for installing the projects are not working HOT 10
- Fix BUNDLE_CACH_PATH HOT 3
- sam project is no running the flag --skip-active-record HOT 1
- where is config/environment.Lamby.cmd ? HOT 3
- Option for PostgreSQL
- Quick start results in internal server error HOT 4
- nginx HOT 2
- environment.Lamby.cmd HOT 1
- Followed each step from the quick start tutorial, receiving an Error 502 Bad gateway HOT 1
- Support OpenId for GitHub Actions CI/CD HOT 6
- Awesome!! Minor docs suggestion HOT 5
- Cannot access lamby-cookiecutter image HOT 4
- Distinct Image CI/CD Action
- "errorMessage": "uninitialized constant Rack::RACK_MULTITHREAD" HOT 3
- Getting GemNotFound errors in Cloudwatch after deploy HOT 1
- ActionView::Template::Error - application.css not present in asset pipeline HOT 2
- Github actions failed to run Deploy HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lamby-cookiecutter.