I'm having this error message come up during Capistrano deployment. It implies to me that something's wrong with Rails being installed or something? Rails is not currently installed on the server side, but it's in my Gemfile (and my Gemfile.lock), so I'm assuming it should be installed during the bundle install command that gets executed before this line.
The actual command that's giving the error is:
bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile
I guess the problem is just that Rails is not being installed during the bundle install. Am I missing something?
Thanks!
UPDATE 1: Rails appears to be installing correctly via the bundle install command. If I check out the directory .../shared/bundle/ruby/1.9.1/gems, I can see action mailer in there.
UPDATE 2: Running the command rake assets:precompile actually fails locally as well, so this doesn't have anything to do with Capistrano it would appear. Now I just have to figure out why the config object doesn't know anything about action mailer?
UPDATE 3: Hot on the trail. It looks like my installed version of actionmailer is 0.6.1 (?!), meanwhile all the rest of my Rails stuff is up at 3.2.9. bundle update refuses to update actionmailer past this version. I'm going to remove all of my gems and start fresh.
UPDATE 4: Deleted my entire gemset using rvm gemset empty. Then tried to run bundle again, and again it tries to get actionmailer 0.6.1. I think something is screwed up with bundler or something...
The problem ended up being that I had removed a dependency upon a specific version of Rails in my Gemfile. I just had gem "rails" in there. That seemed to completely botch the dependency calculations, because it was getting super-old versions of action mailer rather than getting a consistent version from all gems. Guess it's a bad idea to not specify an exact Rails version. Yikes!
#aardvarkk,
Thanks for posting this issue, I was having the same error with my installation of Rails 4.0.0 and the error was preventing me from running my rails server
This is while I'm trying to follow the Hartl Tutorial for RoR.
I added gem "rails", '4.0.0' to my gem file and now I'm able to run my rails server.
Thank you
Related
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
I have been having this problem the whole day. whenever i try to do a rake db:migrate command on rails i keep getting this error.
"error while loading the hoe gem.
Please install it by running the following:
$ [sudo] gem install hoe".
But everytime i run and update all my gems i still get the same error.
The hoe gems i have already installed is the latest version (hoe 3.15.3)
Please help.
Am running rails 5.0.0.1this is the error i keep getting
Do you have the correct version? check your Gemfile.
Use bundle install to install correct version
I kind of found a way around it. I just deleted the previous app folder, created a new one and the problem was fixed. Good thing i was just starting out.
I'm following Michael Hartl's Ruby on Rails tutorial, and I got stuck at trying to start rails server on my Windows 7 machine.
I'm trying to do this by following instructions in Chapter 1.2.5., i.e. by typing
rails server
However, instead of booting WEBrick, this returns the instructions for usage of 'rails' command. I've been googling this for a while, and some of the answers seem to have implied that something is wrong with the rails gem.
Now, I've found the rails gem folder ("C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\rails-3.2.3"), and it's empty!
Also when I try
rails -v
it returns "Rails 3.2.16", although I've removed this version of the gem; if I try
gem list
it kept telling me that the version is 3.2.3.
This persisted until I deleted railties version 3.2.16, which resulted in
rails -v
returning 'Rails 3.2.3', but I still can't boot WEBrick.
Any help would be appreciated.
Did you run the installer?
At the time of this writing, I recommend using the Ruby 2.0.0-p353.
http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.0.0-p353.exe?direct
Save yourself some future gem headaches and install the DevKit too.
http://rubyinstaller.org/downloads/
It should create a folder at C:\Ruby200. Start a new command prompt for the new paths to take affect.
Once Ruby is install, gem install Rails. From your other post, I recommend gem install rails -v 3.2.16
Then execute rails new project_name, then cd project_name. Then run rake db:migrate to create the initial database. At this point, you should be able to run rails server and visit localhost:3000 in your browser.
OK, I've managed to solve my problem.
I've seen a few more people having the same issue, but none of the solutions that I've found helped me, so here's what did it for me, though I'm not 100% sure what exactly was that one thing that actually did it...
I've followed the advice #scarver2 gave in response to my other question, and uninstalled both Rails and Railties gems from my crispy fresh installation of Ruby 1.9.3. (I've installed it using RailsInstaller). Then I've installed Rails 3.2.16 gem by typing
gem install rails -v 3.2.16
and this also installed the corresponding Railties 3.2.16 gem without my intervention.
Then I followed steps from chapters 1.2.3. and 1.2.5. of the tutorial, but making sure that line referencing ruby version in my Gemfile actually corresponds to the version of Ruby that I have installed.
I typed
ruby -v
in the console, to make sure that I have version 1.9.3. indeed. Confirming this, I've edited the Gemfile in my app so it says
ruby '1.9.3'
instead of ruby '2.0.0' line that's used in Listing 1.5. of the tutorial.
After that I've simply went to my app folder, and typed
bundle update
bundle install
in the console, and this time it did not return any errors as it did in my previous attempts. After that, typing
rails server
did what it should have, and my WEBrick server booted, allowing me to access my app on localhost. Yay!
Now, what I think may have gone wrong the last time was either me screwing up the Gemfile, so the gem versions and their dependencies got messed up. I also assume that ineptly trying to fix this by installing and uninstalling different versions of various gems did not quite help. What may have helped was uninstalling Rails and Railties gems, and installing Rails gem again.
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.
Since I am new to rails and have learned the very basics from books I now figured that I can learn quite a bit more from reading other peoples code and trying to make sense of it so I have signed up at github and set up everything there. Now I read that one good open source project to learn from is radiant so I went to https://github.com/radiant/radiant and cloned it to a local directory. THen I proceeded as follows:
cd radiant
bundle install, which went fine
rake db:migrate, which first returned:
rake aborted! You have already activated rake 0.9.2, but your Gemfile requires rake 0.8.7. Using bundle exec may sol
So I typed in bundle exec rake db:migrate and recieved the following:
NOTE: Gem.source_index is deprecated, use specification. It will be removed on or after 2011-11-01. Gem.source_index called from c:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.14/lib/rails/gem_dependency Rake aborted! No such file to load -- radius
So here I am wondering how to fix this problem? I also noticed that a Gemfile and a Gemfile.lock already existed in the radiant folder when it was cloned, which perhaps could be part of the problem?
Also I wonder if it is crutial that I run the same version of rails as the project is written in?
Now it should be said that I currently have rails 3.0.5 installed and run on windows
I hope someone can help me here, it has been quite frustrating since I have not been able to run any cloned github repos (radiant here just being one example).
You should edit your Gemfile and make it require newer rake.
Also you can run rake db:migrate --trace to get additional error information.
The deprecation warning is still just a warning, and it shouldn't be causing you any issues. The part of that error that is relevant is the No such file to load -- radius. You probably need to follow the instructions for installing Radiant, which include running a gem install radiant before dropping this project code somewhere.
Bundler manages installing and using the gems in your Gemfile, and if a Gemfile.lock is present it'll use those exact versions. This means you can't run Radiant with Rails 3.0.5 since the Gemfile specifies 2.3.14. Bundler will install Rails 2.3.14 and its dependencies automatically, though, so you don't need to worry about it.
By the way, this project looks like it has been very mismanaged. It's not common for a Rails project/gem to force you to actually clone it to use it. If you want to check out a Rails 3 project to learn from, I have a slim Rails 3 app that was intended to be an API up publicly on Github with some really clean code: http://github.com/coreyward/instavibe