URI Error running rails server - ruby-on-rails

I am attempting to setup the rails server from the following github project:
https://github.com/Bernie-2016/fieldthebern-api
I know that people were recently able to pull this project and have the server up and running. However, when I attempt after bundle install when I type rake db:setup I obtain the following error:
ground_game_dev already exists
D, [2018-01-17T15:49:44.313281 #7026] DEBUG -- : ** [Raven] Event not sent due to excluded environment: development
rake aborted!
URI::InvalidURIError: bad URI(is not URI?):
I was hoping for some insight into this, I can't figure out a solution

Related

Failure to precompile assets when pushing rails app to Heroku

I'm fairly new to rails and web development in general, so maybe I'm forgetting to do something simple, but I've been stuck on this problem for hours. I'm trying to push my rails app to Heroku, and I keep getting a message "Precompiling assets failed". Scrolling up through the console, the only place I really see errors is
Running: rake assets:precompile
remote: I, [2015-06-09T16:33:23.020943 #736] INFO -- : Writing /tmp/build_a3606aeafbcd156e85ce23a261b8ffd5/public/assets/logo-7f005e1459dfe2528e40b953dcc9b0d4.png
remote: PG::UndefinedTable: ERROR: relation "speed_records" does not exist
remote: LINE 1: SELECT "speed_records".* FROM "speed_records"
remote: ^
remote: : SELECT "speed_records".* FROM "speed_records"
remote: rake aborted!
remote: ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relation "speed_records" does not exist
remote: LINE 1: SELECT "speed_records".* FROM "speed_records"
remote: ^
remote: : SELECT "speed_records".* FROM "speed_records"
remote: (in /tmp/build_a3606aeafbcd156e85ce23a261b8ffd5/app/assets/javascripts/googlemaps.js.erb)
remote: /tmp/build_a3606aeafbcd156e85ce23a261b8ffd5/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `async_exec'
This is a small project that I'm working with others on, and we're all deploying to separate Heroku apps to test our own work as one of the APIs that we're using doesn't work when run on localhost:3000. Other than that, the site runs fine on localhost, but Heroku won't allow me to push to it without errors. Even when I delete everything that I have locally, and clone the master branch from scratch, which is already hosted and working fine on a different Heroku, I still get an error when I try to push it myself. I think part of the issue could be related to the fact that we use the sqlite3 gem for development, but postgres for production, as Heroku requires. However I'm really new to working with databases so I have no idea if that is actually correct or if I'm forgetting to do anything.
Thanks in advance for any help, I've spent hours googling this issue and am completely stumped.
edit: found the solution after spending way too much time on it. The root of the problem seemed to be that I wasn't using "bundle exec" before all my attempted rake commands. From my understanding, this is necessary when the versions of gems you're using for a specific project don't match the versions you've installed system wide.
You need to run migrations. It looks like one of your .js.erb assets is loading some data from a database table that doesn't exist.
You can fix this by running rake db:migrate before you run rake assets:precompile, but you should be aware that your assets will not be dynamically recomputed once precompiled, and whatever data exists in the database at the point of precompilation is the data you'll be stuck using.
I am also faced this type of issue.
Open config/environments/production.rb and make sure the following option is set to true:
then please run
rake assets:precompile --trace RAILS_ENV=production

Not able to access test db from rake tests

I'm unable to execute bundle exec rake because for some reason I can't connect to my database, the error is more than obvious :
rake aborted!
Java::JavaSql::SQLException: ORA-01017: invalid username/password; logon denied
You're seeing Java etc. because I'm using jRuby. So my next move was to start a rails console in test mode which I did with rails console test. Worked just fine, I tried to create a new object just in case and I was able to do it with no issues.
So why is my bundle exec rake failing to connect to the db? And what can I do to fix this? The test db configuration is fine because I can use the test rails console right?
Have no idea what to try next, any hints/tips will be appreciated.

Rails Heroku error of bundle?

After pushed and precompile assets, with I go to my app I have an error.
When I see the logs I have this " ActionView::Template::Error (PG::UndefinedTable: ERROR: relation "rs_reputations" does not exist "
For this new version I installed a new gem 'reputations', and everything is working perfectly in local.
I tried to run Heroku run bundle install but there was no change.
I probably done something wrong, somebody can help me ?
thanks !
You didn't run migration on production server. Run:
heroku run bundle exec rake db:migrate

Rake db:create error - cannot load such file -- resque/tasks

setting up existing apps on my new machine.
The first app (a simple one) went ok.
For the second app most things are ok but now getting
Rake aborted!
cannot load such file -- resque/tasks
when trying to run rake db:create
I've installed redis and I believe it is running.
How can I resolve this error?
Ruby 1.9.3 Rails 3.2.8
Installed the resque gem to fix this.

deploy rails app on heroku

Hey
I'm afraid I should ask a rookie question :
After push my app to heroku. I got error of no database
This is the command I use
heroku rake db:migrate
My app can run locally with no problem, but I notice the database file only in development.
and my test evironment only use rails server and localhost:3000
anyone tell me how to make the database in production mode in heroku.
Thanks
here's the heroku log file:
here's the logs
Started GET "/drummers/1" for
221.9.247.14 at Sat Dec 18 06:17:40 -0800 2010 Processing by DrummersController#show as HTML
Parameters: {"id"=>"1"} Completed in
167ms
ActiveRecord::RecordNotFound (Couldn't
find Drummer with ID=1):
app/controllers/drummers_controller.rb:11:in
`show'
I think it may due to the datebase,config file, become I use sqlite3 in local test, and all the migration file is development prefix,
It's not telling you that you have no Database.
It's telling you that it can't find a specific record
(Couldn't find Drummer with ID=1):
It's likely that you have code that's doing Drummer.find(1) and that doesn't exist on your production environment.
Recommend you either:
create a seeds file (heroku rake db:seed) rails cast
push your entire database to heroku (heroku db:push) [make sure you understand this will wipe out your production database]
Heroku creates a database for each application deployed to it (no need to run heroku rake db:create. Here are the commands you should be using to deploy a Rails application to Heroku:
git init
git add .
git commit -m "initial import"
heroku create
git push heroku master
heroku rake db:migrate
heroku open
I believe Heroku creates a new database.yml for you on deploy if you have no production according to the Docs.

Resources