redcloth (MissingSourceFile) - new problem after Heroku changed to bundler 1.0.7 - ruby-on-rails

Our app had been working. Now I just pushed some new code into staging on Heroku for the 1st time after they moved to bundler 1.0.7. Now our app crashes and I got this error message -
/usr/ruby1.9.1/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require': no such file to load -- redcloth (MissingSourceFile)
We're on Rails 2.3.8.
Here is part of the Gemfile -
gem 'rails', '2.3.8', :require => nil
gem 'RedCloth', :require => 'redcloth'
Any ideas on how to fix this problem? Thanks.

I'm on Heroku and this is what I have :
gem 'RedCloth', '4.2.3'

Related

rails console giving error to add test-unit gem to gemfile

I am getting an error while running rails console:
`require': Please add test-unit gem to your Gemfile: `gem 'test-unit', '~> 3.0'`(cannot load such file -- test/unit/testcase) (LoadError)
If I add this gem to my Gemfile then rails console works fine. But why does it keep asking me to add this gem to my Gemfile?
Rails version 3.2.2
It's rails dependency: https://github.com/drapergem/draper/issues/690
Please read more about that: https://bugs.ruby-lang.org/issues/9711

Rails 3.0 - can't load ruby-oci8 with Bundler

Rails n00b here - need some assistance. I am trying to port a Rails3 app from Linux to Windows. My Gemfile looks as follows:
source 'http://rubygems.org'
gem 'rails', '3.0.0'
gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'
gem 'ruby-oci8', '1.0.6'
I do not have an Oracle client on this Windows machine, so I will not be able to natively compile a ruby-oci8 gem.
I have commented out the 'ruby-oci8' line in my Gemfile and I installed the gem manually from here: http://rubygems.org/downloads/ruby-oci8-1.0.6-x86-mswin32-60.gem. I have also copied the necessary DLLs into ruby\bin.
I have verified that it works:
ruby -rubygems -e "require 'oci8'; OCI8.new('user','password','pasdev:2700/gen11dvu').exec('select * from ARCS_USER_LO
GON') do |r| puts r.join(','); end"
This returns lots of data from my db, so I know it works.
However, if I try to require 'oci8' from a rails console (or from the running app), I get the following:
LoadError: no such file to load -- oci8
I presume this happens b/c Rails only loads the gems specified in the Gemfile, but I cannot figure out how to specify it! I already have the gem I need installed:
C:\javadev\ashbtw3>gem list
*** LOCAL GEMS ***
activerecord (3.0.0)
bundler (1.0.21, 1.0.0)
rails (3.0.0)
rake (0.8.7)
ruby-oci8 (1.0.6 x86-mswin32-60)
...etc...
Yet if I uncomment this line in the Gemfile:
gem 'ruby-oci8', '1.0.6'
bundler tries to download and compile another 1.0.6, which of course fails. I have also tried all of these variations unsuccessfully:
gem 'ruby-oci8', '1.0.6', :platforms => :mingw
gem 'ruby-oci8', '1.0.6-x86-mswin32-60', :platforms => :mingw32
gem 'ruby-oci8-1.0.6-x86-mswin32-60'
gem 'ruby-oci8', '1.0.6-x86-mswin32-60'
Why is bundler trying to install a gem that I already have? How do I properly specify the version and platform to make Bundler see that this gem is already installed, and just include it in Gemfile.lock? Is there some other solution here that I can use w/o installing an Oracle client?
EDIT 1:
As per Kyle's suggestion, I tried the following:
gem 'ruby-oci8', :path => 'C:/Ruby187/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.6-x86-mswin32-60
This made Bundler run successfully!
Using ruby-oci8 (1.0.6) from source at C:/Ruby187/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.6-x86-mswin32-60
However, trying to require 'oci8' from the Rails console now gives me this:
C:\javadev\ashbtw3>ruby script\rails console
Loading development environment (Rails 3.0.0)
irb(main):001:0> require 'oci8'
LoadError: no such file to load -- oci8lib
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in'
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from C:/Ruby187/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.6-x86-mswin32-60/lib/oci8.rb:20
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
The file it's missing is in under ext/oci8 in the installed gem directory, yet it does not see it.
Is there something additional I can do?
Have you tried specifying the :path ?
gem 'ruby-oci8', :path => '/path/to/ruby-oci8-1.0.6-x86-mswin32-60'

heroku - can't activate test-unit (= 1.2.3, runtime), already activated test-unit-2.3.1. Make sure all dependencies are added to Gemfile

I keep getting this error on heroku....here is my gemfile...what do i do
source 'http://rubygems.org'
gem 'rails', '2.3.8'
gem 'will_paginate', '2.3.12'
gem 'googlecharts'
# gem 'faker'
gem 'httparty'
gem 'bandsintown'
gem 'itunes-search-api','0.1.0', :path => 'vendor/gems/itunes-search-api-0.1.0'
gem 'i18n', '0.4.2'
gem "giggly", "~> 0.1.2"
gem "ruby-paypal",'0.0.5', :path => 'vendor/gems/ruby-paypal-0.0.5'
group :production do
gem 'test-unit', "2.3.1"
gem 'pg'
end
group :development, :test do
gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'
end
I tried taking it gem 'test-unit', "2.3.1" out and even leaving it without a specific version and I got this error...
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/file_utils.rb:84: warning: already initialized constant LN_SUPPORTED
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
rake aborted
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
rake aborted!
can't activate test-unit (= 1.2.3, runtime), already activated test-unit-2.3.1. Make sure all dependencies are added to Gemfile.
/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/shared_helpers.rb:108:in `block in cripple_rubygems'
Now I am getting this error
/app/lib/tasks/rspec.rake:1:in `<top (required)>'
test-unit is not part of the bundle. Add it to Gemfile.
/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/shared_helpers.rb:102:in `block in cripple_rubygems'
/app/lib/tasks/rspec.rake:1:in `<top (required)>'
I am so confused...on what to do next
To sum up:
no need of test-unit in production
remove the rspec rake task since you don't use rspec
For me, this error:
/app/lib/tasks/rspec.rake:1:in `<top (required)>'
test-unit is not part of the bundle. Add it to Gemfile.
started unexpectedly when I went to do some maintenance work on an old project. This was triggered by this line in the rspec rake task:
gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f >= 1.9
In returning to this application, the default Ruby version was upgraded to 1.9. Using RVM to set this back to 1.8 (in my case under Jruby) eliminated this message and got me back going as before without the message.
Charles
An error like this can occur if your code loads some gems before Bundler is run and it happens to load a different version than is specified in Gemfile and Gemfile.lock. When Bundler is run later, it will detect that the wrong version of a gem has been loaded and raise this error. The solution is to make sure the Bundler.setup runs before any other gems are loaded. There are instructions on how to do this in Rails 2.3 on the bundler website, which you should follow:
http://gembundler.com/rails23.html

Heroku's trying to install development gems even after I've told it not to

I'm diving into RoR and I'm using Heroku to host the test app I'm building. When I do a push to Heroku, it crashes when trying to intall the linecache19 gem (which is used by ruby-debug19 gem)...
Installing ruby_core_source (0.1.4)
Installing linecache19 (0.5.11) with native extensions /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
After searching all over the web for this problem, everyone's solution was...
heroku config: add BUNDLE_WITHOUT="test development" --app app_name
But the push to Heroku still crashes even after I did that. Here's my Gemfile...
source 'http://rubygems.org'
gem 'rails', '3.0.5'
gem "carrierwave"
gem "mini_magick"
gem "fog"
group :development do
gem 'annotate-models', '1.0.4'
gem 'sqlite3'
gem 'ruby-debug19'
gem 'sqlite3-ruby', :require => 'sqlite3'
end
I even uninstalled the ruby-debug19 gem and it's still crashing and trying to install the linecache19 gem. Why won't this linecache19 gem go away? I'm new to all this and, as such, I'm sure I'm missing something obvious. Your thoughts?
Thanks for your wisdom!
Your heroku config command is malformed. You have a space before add and you are missing the colon between development and test.
$ heroku config:add BUNDLE_WITHOUT="development:test" --app app_name
Docs are here.
Also, are you remembering to run bundle install locally and commit both your Gemfile and Gemfile.lock into git?

Error when creating database with a RoR app

I get this error message when running rake db:create
Could not find gem 'sqlite3 (>= 0, runtime)' in any of the gem sources listed in your Gemfile.
Any ideas on what I should do?
Open Gemfile from the root of your Rails application
Add this line gem 'sqlite3-ruby', :require => 'sqlite3'
run bundle install
run rake db:create
I'm totally new to Rails development, but I had this same problem this week. Eventually, I replaced the line gem 'sqlite-ruby, :require => 'sqlite3' with gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3' (in the Gemfile)
I had to do this because I'm running Mac OS 10.5.8 rather than 10.6
Maybe that will help.

Resources