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'
Related
I just created a new Rails app and I have tried to start the app using the command 'rails server but the app is not starting.
(https://i.stack.imgur.com/eQAvz.png)
I have also tried to run gem install tzinfo-data, Run bundle update and budle install but its still not working. Based on what i saw from those who ran into similar problem, the tzinfo gem is the one that might need to be installed on its own but it didn't work for me.
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.
I've just pushed a new Rails app from my local development machine to a server I have that has a few Rails apps already on, bundle installs everything correctly and rake tasks run fine, however when I try and start the app it fails with that message.
I've:
Trashed my Gemfile.lock and reran bundle install
Done gem install rake to get the latest version
Checked rake --version shows 10.0.4.
Checked bundle show rake shows 10.0.4
Restarted the server
Now I'm drawing a blank on what it could be. Using Phusion Passenger, rails 3.2.13, ruby 1.9.2p290. I use rvm for managing the environment, but I've not changed anything with it for a long, long while now. The other Rails apps are all working okay without any issues, with similar gem dependencies.
Self fixed, but not sure why. I ran bundle install rake by accident, forgetting it doesn't do what I think and it created a ./rake folder which solved the issue.
Perhaps your application is being run as the wrong user.
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.
I've been running Twitter Bootstrap successfully for months on my Rails 3.2.1 app
I did a push to Heroku and the push failed on assets:precompile and the whole app crashed
Running assets:precompile locally also failed with the following error:
no such file to load -- less
(in /blah/blah/app/assets/stylesheets/bootstrap_and_overrides.css.less)
There have been no changes to my bootstrap_and_overrides.css.less or bootstrap_defaults.css.less files, but I suspect there has been a Gem update (how can I tell?)
I have managed partial recovery by ADDING the gems:
gem 'less-rails-bootstrap'
gem 'therubyracer'
(rubyracer being required by the other gem)
I also did a rails g bootstrap:install -f and reinstated any custom lines in bootstrap_and_overrides from a backup
I also reverted to a Git commit from where I knew it was working
However, I have only partial success - with some site CSS styling now different than originally
What is it that has happened here? And how can I go back to my original setup?
Even though your problem is resolved, I just want to add this for anyone else who runs into the same error: In my case, I simply needed to restart my server. I had added three related gems to my Gemfile (less-rails, therubyracer, and twitter-bootstrap-rails) while my local server was running, resulting in the same problem seen above. So once I shut it down and restarted it again, everything loaded well.