I am trying to push my Rails app to Heroku and I am getting the following error:
Could not find i18n-0.6.7 in any of the sources
Gemfile.lock has the following line:
i18n (0.6.9)
When I do a Google search about my problem I found out that i18n-0.6.7 has been yanked. My project runs fine in development but when I push to production in Heroku is when I get this error.
Any ideas? Running bundle update, bundle install etc... has not yielded me any results.
Thanks!
The problem is indeed that the version has been yanked, and therefore heroku cannot install it while compiling your push. The reason it works locally is because you still have that library on your machine.
Take a look at your Gemfile.lock and find instances of the i18n gem. When they are far indented, the lines above them in the hierarchy are the ones that list i18n as a dependency. Try updating those gems first.
Related
I'm trying to create my first rails app. I'm on a Macbook Pro, so macOS.
I've been following this guide setting up rbenv, rails etc.
https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-macos
Then I'm following a crash course on YouTube. In the terminal I try to create a new rails app
rails new foodlog
It starts to set up in the folder I made for it, but the following happens during setup
Bundler::PermissionError: There was an error whle trying to create
'/Users/myusername/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/extensions/arm64-darwin-21/2.7.0/racc-1.6.0'.
It is likely that you need to grand executable permissions for all parent directories and write permissions for
/Users/myusername/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/extensions/arm64-darwin-21/2.7.0'
This error continues repeating the same thing with things such as "strscan".
Then after it says
In gemfile:
rails was resolved to 7.0.3.1, which depends on
actionmailbox was resolved to 7.0.3.1, which depends on
net-imp was resolved to 0.2.3, which depends on
stscan
run bundle binstubs bundler
Could not find gem 'sprockets-rails' in locally installed gems.
rails importmap:install
Could not find gem 'sprockets-rails' in locally installed gems.
Run 'bundle install' to install missing gems.
rails turbo:install stimulus:install
Could not find gem 'sprockets-rails' in locally installed gems.
Run 'bundle install' to install missing gems
I've tried looking online, coming across similar but not exact issues. For example, one solution suggested doing bundle install in this directory, versus where the guide says do it in the home directory. So I do that and get
Bundle complete! 0 gemfile dependencies, 1 gem now installed.
Still doesn't do anything. I think the main culprit is the permissions error it mentions above? This is my first time trying to really do any development on the macOS and I'm sure there's just a misunderstanding somewhere regarding permissions, so if anyone can help that would be appreciated!
It is likely that you need to grand executable permissions for all parent directories and write permissions for
/Users/myusername/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/extensions/arm64-darwin-21/2.7.0'
Your question does not mention, so I think you might have missed this suggestion. Make sure all directories have the executable permission
I am setting a new app, stack is:
ruby: 2.6.1 (using rvm)
rails: 5.2.2
bundler: 2.0.1
Now thing is, bundler 2 doesn't use Gemfile at all, i have proper gems.rb and gems.locked and everything was working properly until i pulled some code from a co-worker which got merged.
Issue is whenever i run any rake or rails command i get this error:
/path/to/proj/Gemfile not found
I then even tried going back to old master when that code was not merged and issue is still there. So it is probably not something in the code i pulled.
And issue seems persistent in different machines.
I know there are other issues which have similar errors of Gemfile not found but those are mostly those which had wrong directory opened or some gem issued fixed by bundle update or gem update type commands, this is not that issue because. This is something else, because bundler 2 doesn't even need Gemfile.
It looks like rails doesn't support using gems.rb and gems.locked. https://github.com/rails/rails/issues/31295
You could try what that guy did and edit some files, or you could rename your gems.rb back to Gemfile and gems.locked back to Gemfile.lock
Bit of a strange question, but here goes.
I'm a relative beginner to rails, and I've just started working on my second app locally. However, after each install I'm getting the following problem - that several gemfiles are missing (railties being the most obvious).
So, I deleted the install, re-ran it and listed the gemfiles - they are all there. However, after initializing a git repo and pushing the project up to my GitHub a gem list command shows that a number of gems are now missing - at this point I can't run any rake commands or for example rails server.
So I cleared the repo and re-installed. gem list says the gems are all present, server and rake commands work; but push the repo and it subsequently packs up - gem list shows only a handful of gems remain.
Bearing in mind my experience, I'm prepared to believe I'm missing something very obvious, but any advice would be appreciated.
welcome ;-)
I suppose you want to create a Rails 3 application. So first make sure you have installed bundler.
gem install bundler
The steps for creating the application are:
rails new your_app
Then run bundler in the applications folder:
cd your_app
bundler install
Now you should be able to run the application:
rails s
Go and visit localhost:3000. If that does not work, you have other problems. Paste the stack trace then ...
The problem was I forgot that I had two versions of Ruby installed and I had not properly set a default with rvm for some reason. Specifying the default then checking the gems were present for that version of Ruby fixed it.
I just tried deploying my app to Heroku. It's been working for quite a while, I am just adding some new features. Once I deployed, I got an "App Crashed" error. heroku logs showed No such file to load -- nokogiri (LoadError).
Now, on my system, my Gemfile.lock showed 2 different nokogiri gems: nokogiri (~> 1.5.0), a dependency of fog (1.4.0) and nokogiri (1.5.5-x86-mingw32) which doesn't appear to be a dependency of anything. Under platforms was only x86-mingw32. My development computer is Windows 7 with ruby 1.9.3p194 and the Ruby version that the Heroku toolbalt uses for itself is heroku-toolbelt/2.30.1 (i386-mingw32) ruby/1.9.2.
My version of Bundler was up to date, my version of the Heroku toolbelt was up to date. I tried deleting Gemfile.lock and re-deploying on the advice of some forum posts, but the app was still crashed.
It appears that Heroku was simply not bundling in the right version of nokogiri, but was ignoring it on account of my use of Windows. The way I got to to be fixed was I added gem 'nokogiri', '~> 1.5.5' to my gemfile (even though my app does not explicitly need nokogiri, it is only a dependency) and then re-deployed to Heroku without running bundle install on my own system first. Now the app does not crash.
I have no idea why this worked. I don't know how to ensure the problem doesn't occur again, I just happened to get lucky with a desperate patch. I can't have this downtime in the future, or worry about something like this happening again for a routine deploy. Can someone please explain what was actually wrong and the right way to solve it?
Add this
PLATFORMS
x86-mingw32
to your Gemfile. Heroku will then ignore your Gemfile.lock because windows has crazy different dependencies.
I'm getting this error with Passenger:
https://github.com/huerlisi/PDFKit.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError)
When I run cap deploy (I'm using capistrano), it's saying that it's bundling the gem, so I'm not sure what's wrong.
I'm the huerlisi who's PDFKit branch you're using. I just want to tell you that you should consider switching back to the original branch at https://github.com/jdpace/PDFKit as I'm not maintaining my branch, and the 'always render as PDF' bug has finally being fixed:-)
If you're installing gems from a git source, you will need to install them using bundle install as the error says. The contents of them are usually saved in ~/.bundler and loaded in from there according to the specific version saved in Gemfile.lock.
What could be happening is that your application does not have a valid Gemfile.lock to latch on to and uses system gems by default.
What does bundle check show on your installed app?
It is not uncommon to have gems installed for the wrong version of ruby if you're using something like rvm.