I am trying to follow the Redmine guide here.
I am running into the same problem this previous post, but the solution didn't solve it for me.
Steps that I have done so far:
Ruby
I have downloaded/installed the Ruby from http://rubyinstaller.org and verified that Rails was installed.
rails -v
Rails 5.1.3
ruby -v
ruby 2.3.3p222
MySQL
Visual Studio 2019 redistributable installed.
Ran the MySql installer msi
Selected the Developer (Defaults)
Took all the defaults for the rest of the wizard (I did set root password and added a user)
*I think I had to do all this first before starting the Installation procedures.
Redmine
Completed step 1-4 with the MySQL settings
Step 5
Running the command:
bundle exec rake generate_secret_token
Could not locate Gemfile or .bundle/ directory
I have verified that rake is installed
rake -V
rake, version 13.0.1
gem list rake
(rake 13.0.1)
Using the stackoverflow post from above, I did update the version of rake I had installed, but that didn't solve the issue. I am new to gem/bundle type of installs, so I may be missing something that is quite obvious.
Do I need to be a specific directory when running these commands?
Any direction for me would be good. I am trying to run this on a Windows Server if that makes any difference.
Redmine is a Rails app. You must download the app, extract it, then change into that directory before running your rake task. The process for this is defined in step 1:
Get the Redmine source code by either downloading a packaged release or checking out the code repository.
See the download page for details.
Afterwards, you can run bundle exec rake generate_secret_token because that is a Rake task defined by lib/tasks/initializers.rake. Rake tasks in Rails are typically defined within the lib/tasks directory and you can see multiple examples there.
If you attempt to run rake something then Rake is going to look for a Rakefile where this task is defined. Since you're currently just in your Ruby bin/ directory there are no defined rake tasks so you get the errors that you see.
Related
I have a problem with Solidus 2.10.2 where when I run rails g spree:install several migration errors come up. Starting with [Spree WARNING] Missing migrations. and ending with [Spree WARNING] Run bundle exec rake railties:install:migrations to get them. but when I run bundle exec rake railties:install:migrations nothing happens...
I tried deleting the database (rails db:drop) and all my custom migration files as well before running the spree generator again however I get the same results. I put the full error in a bitbucket snippet (https://bitbucket.org/goldenBoySailsLow/workspace/snippets/5LGqez) I would appreciate any help
system info: rails 5.2.4.4, ruby 2.7.2, ImageMagick 6.9.10-23 and sqlite3 3.31.1 running on ubuntu 20.04 lts
I just had the same issue because I forgot to specify the version in the Gemfile. When I deployed, it started using solidus 2.11.2 instead of 2.10.2.
Specifying the version solved the problem for me.
I can't launch my server with the command rails s, I have to use the command bundle exec rails s, but I prefer use the command rails s
Error when I launch the command rails s
Traceback (most recent call last):
1: from /home/leopaul/.rbenv/versions/2.5.1/bin/rails:23:in `<main>'
/home/leopaul/.rbenv/versions/2.5.1/bin/rails:23:in `load': cannot load such file -- /home/leopaul/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/exe/rails (LoadError)
My rails version is :
Rails 5.1.6.2
I think you have multiple Rails versions installed in your machine.
Sometimes when you install a gem it comes with an executable/binary as well. Examples of these include: rails, rake, rspec, pry, etc. However, when you have multiple versions of a gem installed you then will have multiple versions of these executables sitting around. So if you want to execute one of these binaries for a given rails app you may need to disambiguate which executable you want -- the one for rake v10.1 or the one for rake v10.2, for example.
So for most commands you'll want to run bundle exec to make sure you're running the right version for your project (and also to make sure that all dependencies are also loaded from the correct versions specified in your Gemfile.lock).
So answering to your question if you are able to do bundle exec rails s and unable to do rails s try reinstalling rails gem to your local machine.
gem install rails
then check current version by rails -v
I would just like to add that in my case rubygems wasn't installed.
Running sudo apt-get install rubygems solved the issue!
See docs: http://railsapps.github.io/updating-rails.html
It seems that you have installed globally is rails 4 or some other rails version and it's the reason "it doesn't execute rails s" like you say because it consider default(global rails version) rails. When you run bundle exec then it uses the rails commands from the current Gemfile, since you have rails 5 in your Gemfile then it works properly.
Also try to create gemsets for every project.
In case your case, try this:
bundle update
then excecute
rails s
Hope it will work :)
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
Hello
I am currently using:
Ubuntu 10.04LTS
Netbeans 6.9.1 (with embedded JRuby 1.5.1)
JDK6u17
GlassFish Gem 1.0.2
I am using a old JDK because of this bug:
http://jira.codehaus.org/browse/JRUBY-4785
I have partially completed application, but i want migrate to rails 3(currently application is in rails 2.3.8).
So i go to:
$HOME/netbeans-6.9.1/ruby/jruby-1.5.1/bin and type: jruby gem install rails -v=3.0.3. Everything is OK.
Then i create a sample RoR project and use some simple scaffold. Works.
But when i choose in Netbeans rake db:migrate it shows me message: "db:migrate" taks does not exist.
Any idea how to fix that?
I would be grateful for the help.
UPDATE
I have tested this in Ubuntu and it works fine.
But in Mac OS X this trick don't work.
So I made a symbolic link called jrake to jruby/bin/rake
cd /bin
ln -s /Applications/NetBeans/NetBeans\ 6.9.1.app/Contents/Resources/NetBeans/ruby/jruby-1.5.1/bin/rake jrake
and I just type jrake db:migrate in project Directory and it works.
Does this link help?:
http://www.blakes-site.co.uk/blog/13/Fix-NetBeans-dbmigrate-task-does-not-exists-error/
UPDATE
Link broken - From the Google Cache of Blake Simpson's blog:
I have recently reinstalled Ruby on Rails 3.0.0 and created a new
Rails project in NetBeans 9.6.1
I could not migrate my database, or any other rake tasks for that
matter. I kept getting the error:
"db:migrate" task does not exist
The solution is to right click your project select "Run/Debug Rake
Task" and then click the button titled "Refresh Tasks".
Once this is done you should see a list of all your rake tasks. After
this you can simply re-run the db:migrate task and it will work.
I'm running a crontab that executes a rake task. I'm getting the following error (with MAILTO from crontab):
rake aborted!
no such file to load -- bundler
/Users/Mendel/Sites/misnooit/Rakefile:4
(See full trace by running task with --trace)
I'm using rvm with:
ruby: ruby 1.9.1p378
rails: Rails 3.0.0.beta
$GEM_HOME: /Users/Mendel/.rvm/gems/ruby-1.9.1-p378
bundler: bundler (0.9.11)
The error is pretty self explanatory but I'm not able to fix it.. Is there someone with more knowledge about this matter? Thanks in advance.
I just experienced this. Problem for me was that the instances of rake and ruby I use were built locally, and installed to /usr/local/bin. There are other versions in /usr/bin (must check what I installed using apt-get in the past..).
So, in my crontab file I set the path using
PATH=/usr/local/bin:/usr/bin:/bin
(I was seeing it as PATH=/usr/bin:/bin in the failed crontab emails)
and it works.
Just guessing: is Ruby 1.9.1p378 your default Ruby?
I think it's not so you can just execute rvm --defaults "ruby-1.9.1-p378"
If this doesn't help, are you sure bundler has been installed when ruby 1.9 was used?
Also, in your test/production environment, you may want to run you cron with another user than yourself. So I suggest you install rvm as "root", and set up (still as root) a default RVM that will be the default for all the system users.
And of course, you can override this per user.
I've had good experience using http://github.com/javan/whenever
It uses a Ruby DSL to manage cron tasks and it handles setting all the environment magic.
every 3.hours do
runner "MyModel.some_process"
rake "my:rake:task"
end
have your run the command with --trace asserted to ensure there isn't something obvious in the rake command, but what you could do is chain the crontab commands
rvm 1.9.1;rake do_whatever_task
That way it will load the ruby environment every time prior to running rake.
I had a similar issue this weekend, I found that my Rake Gem was updated to 0.90 you need rake 0.8.7. This solved the issue on my end.