I downloaded and installed Ruby, Ruby gems and with it installed Jekyll. Started a test project with Jekyll. Want to deploy it on Heroku (because gh-pages don't support plugins on Jekyll).
Read docs on Heroku for ruby, downloaded and installed JDK 8 and JRuby 9.1.17.0. Installed bundler.
Logged in Heroku, and executed following commands in terminal:
heroku create
git push heroku master
heroku open
The new heroku app build succeeded but the website fails to load. It displays error like so:
This is the error displayed when I check heroku logs
I also built a Procfile in the root folder for the test project. Entered the following code:
web: puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}
I'm not sure what went wrong. Please help!
You need to figure out what's your web-server by default. As advised by Roberto, it might be puma.
By the default, when you run rails new, it always has the web-server gem (puma, passenger, unicorn or anything else).
It seems that you've copied some settings? And that's why you don't have puma in Gemfile, but trying to run it. You might share the Gemfile list to let you know what's wrong.
Related
I'm setting up the staging and production server on Ubuntu, deploy with Capistrano. Both server has pretty much the same setup. But for for some reason. I can access console on production server with rails c produciton. But when I try to access console on staging server using rails c staging
The program 'rails' can be found in the following packages:
* ruby-railties-3.2
* ruby-railties-4.0
Try: sudo apt-get install <selected package>
The only way to access console on my staging server is to do
bundle exec rails console staging
On staging
the rvm seems to be correct, I can see the ruby version I'm using.
the gemset that the application use is there.
the application is running fine. Just can't access console with 'rails c'
But for some reason, I can't access console with rails c. Any idea how to solve this issue?
I guess you didn't install rails globally. First, check your rails version you are currently using by bundle exec rails -v. Then, install rails globally by gem install rails -v <version>. This should solve your issue.
Run bundle install only makes rails available inside bundler. In most cases, this should be enough, because bundler helps prevent headaches of version conflicts.
A couple of questions to understand better the situation...
Have you tried running bundle install for the current ruby version set on rvm for that application on that server?
Have you updated the gems for another application/branch? sometimes that happens because the rails c command uses the latest gems available and bundle exec... locates and uses the gems tied to the Gemfile.lock.
The application should run fine because it uses the gems that the Gemfile.lock has listed.
I just published my rails app to Openshift and I got the error message:
We're sorry, but something went wrong.
The log file says:
Could not find rake-10.4.2 in any of the sources (Bundler::GemNotFound)
I do not know how to debug this issue. This has happened to about 3 apps I have deployed in the last couple of hours.
Hers is a link to the full ruby log file:
https://gist.github.com/kinsomicrote/e3715be509a7375758ef
Seems that you have problems with gems and passanger.
Did you run bundle install on the host? (if you have Gemfile)
If you already do, try to install puma or thin, and start webserver running bundle exec puma -b 0.0.0.0:8080 -d
to check if it working. Passanger sometimes is hard to setup.
I updated a gem(rtf) in my ruby on rails app through the Gemfile. The app works fine on my localhost but when I pushed changes to heroku and tried 'bundle install' within heroku bash. I see that the gem has been installed based on the log
Using rtf (0.3.3)
Following this, I did a
heroku restart --a myapp
however, when i tried the app on heroku, it still cant recognize the lib installed through the gem, i get the following error(normally appears when the library cannot be reached for command "require 'RTF'").
cannot load such file -- RTF
What am I doing wrong in heroku?
I think you misunderstand how Heroku works. When you run a bash shell on your app, nothing you do on that dyno will affect any other dynos for your app (like your web dynos). Heroku runs bundle install for you when you deploy your app and if your Gemfile is configured correctly all the gems will be installed.
the answer by sevenseacat is right- i had just got the case wrong-
require 'rtf'
works fine. In OSX, it ignores case in the command require 'RTF'
I'm having lots of problems trying to deploy using capistrano. I keep on getting errors about libv8 not in any of the sources.
Could not find libv8-3.11.8.13 in any of the sources
Here https://github.com/cowboyd/libv8/issues/56 tells you that you could "not to use packaging", that way, the deployed app won't use the bundle package.
How can I deploy and use the gems NOT IN THE BUNDLE PACKAGE? I want the app do run bundle everytime I deploy instead or to just run bundle when the Gemfile has changed.
This is how I got it working: https://github.com/cowboyd/libv8/issues/77#issuecomment-12711634
I'm doing development on a mac and deploying to a red hat server. It seems Rails needs a OS, platform-specific version of the gem. So when I'm running bundle on my development machine (mac) and then deploy it with capistrano to the production server (red hat), it won't work.
What I ended up doing is...
manually download the libv8 gem I needed from http://rubygems.org/gems/libv8
copy the downloaded gem to the vendor/cache folder
then deployed the app (cap deploy:cold)
and it worked.
If I understand your question correctly it sounds like you're missing the bundle capistrano task. See https://github.com/carlhuda/bundler/blob/master/lib/bundler/capistrano.rb for more. You should be able to "require 'bundler/capistrano'" to your capistrano deploy.rb file so that bundle is run on every deploy.
This is my first stab at Ruby on Rails. Just deployed a very simple app to Heroku.
The thing is that my app runs flawlessly on mongrel development; When I run it with "mongrel_rails start -e production" however, I get the error "We're sorry, but something went wrong."
For the life of me, I couldn't debug this. Heroku logs is not returning anything, the Exceptional addon in Heroku is not returning anything, and I cannot find mongrel.log on my Windows machine (when I run mongrel using: mongrel_rails start -e production -d"
I'm using Rails 2.3.5 and sqlite3 with bundler to pack my gems.
I was told that probably rails is not booting up correctly. I can't find any other way to diagnose this. Any ideas?
Thanks,
ANaimi
Take a look at your log/production.log file. That should contain detailed information about what's going on. It will usually contain a line that specifies the name of a gem that needs to be installed.
Heroku doesn't use mongrel, so I'm assuming that's what you're trying to do to figure out why it isn't working when you push it to heroku.
I've found, in most cases, my heroku problems have been because of uninstalled gems. Make sure you create a gem manifest.
Try tailing logs while booting up. From the terminal in the log directory do: tail -f *.log and then launch the app from another terminal (likely it's development.log since you're probably running in development mode.)
Not sure if this got definitively answered, however, check your '%app_root%/config/environments/' folder, and compare 'development.rb' to 'production.rb'.
Make sure that you have all necessary settings in the production.rb file - might have missed something important there.