Push Rack-Jekyll app to Heroku - ruby

I haven't used Ruby. I don't know what gems are. But I know how to install them and do basic things like that.
I heard of Jekyll and decided to start my own using Heroku. I found Rack-Jekyll that will work on Heroku.
I created my site as per Jekyll instructions and it is running fine on my system. Then I did what I was told to do in http://github.com/bry4n/rack-jekyll#readme. But when I push it to Heroku, I get an error:
---> Heroku received push
---> Rack app detected
---> Installing rack-jekyll from http://rubygems.org
ERROR: could not find gem "rack-jekyll" locally or in a repository
On seeing this, I downloaded the rack-jekyll.gem file and committed it to the repsitory and tried uploading it. Even that didn't work. Can you tell me precisely what to do?

Updated (ht Andrew): use heroku's Bundler support
create a Gemfile like so
source "http://rubygems.org"
gem "rack-jekyll"

Related

Heroku is ignoring bundle configuration

I'm trying to install the gem 'taglib-ruby' on Heroku. This gem compiles as a native extension which requires a system dependency called taglib, so after compiling and uploading it through heroku vulcan, I achieved to compile the gem via command line on heroku bash:
bundle exec gem install taglib-ruby -- --with-opt-dir=/app/vendor/taglib
And in order to this parameter would be used by bundler later, I added it as a bundler configuration through the command:
bundle config build.taglib-ruby '--with-opt-dir=/app/vendor/taglib'
I've already verified this config was applied, inspecting the file /.bundle/config and looking for the line BUNDLE_BUILD__TAGLIB-RUBY.
However after pushing out my project to heroku and while it is executing the bundle install command, heroku complains that the above gem (taglib-ruby) cannot be installed due the taglib library isn't present, although it's what I was trying to solve with the option '--with-opt-dir=/app/vendor/taglib' mentioned above.
So it appears that Heroku is ignoring the bundler configuration.
What could be happening? Do you know another way the achieve the same intention (install a gem with custom build options) on Heroku?

Installing gems on node heroku projects

I'm writing a node app on heroku, and the app requires a gem, compass to be installed, for node-compass.
However, I can't seem to work out how you install gems in a node application on heroku. I have a Gemfile, which looks like so.
source "https://rubygems.org"
gem 'compass'
Have you managed to do this successfully before?
According to an official reply from Heroku for this question:
You would need to use the heroku multi buildpack in order to have both the Ruby buildpack and the Node buildpack: https://github.com/ddollar/heroku-buildpack-multi
In addition to a Gemfile, you need a buildpack and a Gemfile.lock. I wrote up how I got this working in this answer to a slightly different question, but I think it should answer this question too.

Deploying to Heroku without a Gemfile

I'm working with an old Rails app that was initially built before Bundler and Gemfiles. Is it possible to push this app up to Heroku without a Gemfile? The app is in production on the Bamboo Stack and working without one. I'm trying to add a development environment on the Cedar Stack (Bamboo is now closed) and getting an error:
-----> Heroku receiving push
-----> Removing .DS_Store files
! Heroku push rejected, no Cedar-supported app detected
Is it no longer possible to push to Heroku without a Gemfile?
I'll add a Gemfile if that's what it takes.
The official word from Heroku Support:
Hi, yes you need a Gemfile for ruby apps; we don't have any gems
installed on the base system so that's how you specify them. That's
also how we detect it's a ruby app.
Also potentially useful: https://github.com/kch/gemfile-tool

Installing heroku client only, and not the other things

I am using RVM for my Ruby installations.
I recently encountered a problem installing the heroku toolbelt with it installing Ruby 1.9.1 on my actual system, which then rewriting environment variables, and breaking my ruby cli. I had to delete everything, reinstall RVM, reinstall gems, ect ect..
The point is, I wish to be able to use the heroku client, and possibly foreman, but I don't want the toolbelt trying to install git, and ruby 1.9.1 on my system.
I tried to do the gem install version, but it states that the gem is depreciated, and for me to install the toolbelt.
Any help will be greatly appreciated.
Thank you for all thoughtful answers.
Go to the Heroku CLI on github and download the tarball from the other setup. Extract the Tarball and move the resulting files under /usr/local/heroku. Add /usr/local/heroku/bin to your PATH. Ensure that Heroku gem is removed from any project gem files. Reload your terminal and the Heroku CLI should be working.
You can run which heroku from your project directory and you should get /usr/local/heroku/bin/heroku.
As it is self updating you should only need to do this once.
If you want Foreman just use the Gem version.
Git and Ruby will not be installed using this process.
Update: Heroku now have an install script for a standalone install of the Heroku Client without Foreman and Git.
On Windows, the Heroku Toolbelt installer offers a choice between Full Installation and Custom Installation. If you choose Custom, you can select which components you want to install.

Rails : Trouble installing attachement_fu on Heroku

I'm trying to deploy an app on heroku.
My trouble is to install hattachement_fu plugin.
I ran the following command to install it directly on the server.
heroku plugins:install http://github.com/technoweenie/attachment_fuand"
and I get the following message :
Unable to load plugin: some_plugin: uninitialized constant ActiveRecord
Already up-to-date.
attachment_fu installed
So seams that the plugin is installed but something get wrong above ...
But in my logs I continue to get :
NoMethodError (undefined method `has_attachment' for #<Class:0x2b3fed47a830>):
Like if the plugin was not there.
Any idea about what's going on ?
That's not how plugins work. The command you used is for installing plugins to the heroku command line tool.
If you want to install a Rails plugin, go to your project folder and script/plugin install foo (or however your version of rails installs plugins), commit it, then push to heroku.

Resources