My terminal is showing this at the start of the command line:
subalcharla#subal-charlas-macbook ~ $
And as a consequence when try to create a new app using rails with the command:
subalcharla#subal-charlas-macbook ~ $ rails new sample_app --skip-test-unit
The app that appears in Finder in my Mac 10.5.8 is named new instead of sample_app. Also, --skip-test-unit does not seem to be working.
Please help.
Looks like you have an older version of rails installed to check the version in you terminal type
rails -v
if the version is < 3.0, update rails to 3.2
gem install rails -v 3.2
Related
I have just set up ruby and rails on a freshly installed freeBSD. It works great. I can do rails new blabla mv into blabla and do rails s and it just works.
I had an up and running rails app on another computer. I copied the repertory that contained the app to the new computer running freeBSD. However, when I mv into that repertory of the rails app and to rails server I get -bash: rails: command not found
I have tried creating a new app with the same name and let rails create all the repertories and then copy the files of the existing rails app therein but no success.
I can run rails -v and rails s from within any repertory and get correct answer, but when I move into that specific repertory I get that command not found.
You're probably using a ruby version manager I suspect (rbenv/rvm)? Check the ruby version in your Gemfile (top of the file). It probably isn't the same as the ruby version you have installed. If you're using one of the above mentioned version managers than install the correct ruby for your rails project. After that you can do a gem install bundler in the project directory and after run bundle install which will install rails and all dependencies.
Which version you are using? It happens with earlier versions. Try updating your gems and bundler. And try again. Hope it helps.
Did you try running bin/rails s? I think tha you need run bundle install too.
I'm trying to create a new rails 4 app with this system setup:
OSX Mavericks
zsh
rvm 1.23.13
bundler 1.3.5
ruby 2.0.0-p247
I've installed bundler and rake in the global gemset for ruby 2
After I have installed rails 4 in the gemset I execute
rails new testapp
I get the the error:
Looks like your app's ./bin/rails is a stub that was generated by Bundler.
All of the references to this I've found are in relation to upgrading 3.2 to 4. I'm wondering if anyone has any suggestions in this situation.
The full sequence is in this gist
is it possible that ~/dev/eit is already an rails application?
try this:
mkdir -p ~/dev
rails new rails4app
cd rails4app
rails s
command creating new project inside project directory instead of starting server.
I installed rails in my system but it is showing unexpected behavior, as creating project instead of starting server.
I see in my system by running gem list | grep rails command it shows rails 3.2.11 but when I see using rails -v then it shows rails 2.3.11
SO on running rails s it picks rails 2
Please check Your version of rails. It is definitely < 3.
So use ruby script/server instead of rails s.
You will be running the first version of rails that is found in your PATH. You can always change your path environment variable so it finds rails 3.2.11 first, but if you are trying to manage several versions of rails/ruby on your system I recommend you use rvm or rbenv.
Thanks #Gosavi and #boulder
Your solutions are also worthy, but my prbolem was resolved doing this
My app was poiniting to default gemset so I created new gemset for my app
To create new gemset
rvm --rvmrc --create 1.9.3#project_name
To list avaliable gemsets:
rvm gemset list
I entered a existing ruby application, and type:
$ rails s
wanted to start rails server here.
but it said:
Your Ruby version is 1.8.7, but your Gemfile specified 1.9.3
Actually, I had a 1.8.7, but I deleted it. And if I do:
$ ruby -v
it said:
ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-darwin11.4.2]
So I don't know how can I fix it. Can you give me a help?
If you are using rvm, run this:
$ rvm use 1.9.3
try using bundler
bundle exec rails s
I had similar problem:
$ bundle install
Your Ruby version is 2.1.0, but your Gemfile specified 1.9.3
but:
$ ruby -v
1.9.3-p484
$ which ruby
/home/malo/.rvm/rubies/ruby-1.9.3-p484/bin/ruby
I've found five answers: 1, 2, 3, 4, 5. Also it was open issue on github. However, I've resolved the problem as follows:
Got path to my bundler:
$ which bundle
/home/malo/.rvm/gems/ruby-1.9.3-p484#global/bin/bundle
Opened it to edit (or just cat it), and saw that it has invalid link to ruby in the first line:
$ cat $(which bundler)|head -n 1
#!/home/malo/.rvm/rubies/ruby-2.1.0/bin/ruby
Then I get the path to current valid ruby, and just replaced that invalid with it:
$ which ruby
/home/malo/.rvm/rubies/ruby-1.9.3-p484/bin/ruby
Of course you can also try replace it with the common form:
#!/usr/bin/env ruby
This should pick up the currently used ruby version.
I found out the reason I was getting this error was that I was shelling out to a Heroku command line program inside of my configuration files and Heroku Toolbelt comes with it's own version of Ruby.
The two solutions to that problem are to either not shell out to Heroku or use a Bundler.with_clean_env block instead of the backticks to shell out the heroku command.
Please try this:
1. Open your gemfile
2. Specify rails version
3. Run bundle update
4. Run rails server - rails s
Every now and then this happens with me. However I often don't like switching ruby versions here and there. So instead what I do is I just go to the Gemfile and switch the ruby version to the one that I am using. Doing this allows me to fire up my server and keep working on things.
so for instance, right now for the app i'm working on, my Gemfile is at
ruby ENV["CUSTOM_RUBY_VERSION"] || "2.1.6"
and I would just alter it to
ruby ENV["CUSTOM_RUBY_VERSION"] || "1.9.3"
I am trying upgrade Rails. I am pretty sure that Rails 3.1 is now installed, however my rails apps still have no Gemfile, and rails -v returns 2.3.5. When I type "gem uninstall rails" I get:
aheine#ubuntu:~/www$ gem uninstall rails
Select gem to uninstall:
1. rails-3.0.9
2. rails-3.1.0.rc1
3. rails-3.1.0.rc5
4. All versions
How can I get rid of Rails 2, and make rails 3 the default version to use?
I am using Ubuntu 11.04
Your running with the system provided Rails, run apt-get remove rails and then you may need to make a configuration change so the system can find the proper rails command. So see if that works and then try running rails -v if that returns command not found add this line to the beginning of your .bashrc file in your home directory.
export PATH=/var/lib/gems/1.8/bin:$PATH
After that's done open a new shell and try running rails -v again.