problems installing ruby on rails - ruby-on-rails

I have a question regarding my Ruby on Rails installation.
I am using ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
and rails -v
Rails 3.1.3
When I create a new app with
rails new first_app
I get 2 new application directories (first_app & new) which is kind of strange to me because I thought I should only get one 'first_app'. This seems to be behaviour of Rails 2.x
Also when I type command
bundle install
output is
Could not locate Gemfile
And its true - there is none in the application directory
app config db doc lib log public Rakefile README script test tmp vendor
Any idea why this is going to happen?

Related

Why Heroku is still not using my Ruby version 1.9.3?

I followed every step in here:
I have this in my gem file
ruby "1.9.3"
and then when I deploy heroku says:
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-1.9.3
-----> Installing dependencies using 1.5.2
Then when I do
heroku run "ruby -v"
I still get
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
Then I added a path:
heroku config:set PATH=bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin
Deployed again, and still same result:
I tried:
heroku config:set PATH=bin:vendor/bundle/ruby/1.9.3/bin:/usr/local/bin:/usr/bin:/bin
Still no use:
In my heroku Log I get this:
/app/vendor/bundle/ruby/1.9.1/gems/bundler-1.5.2/lib/bundler/definition.rb:390:in `validate_ruby!': Your Ruby version is 1.9.2, but your Gemfile specified 1.9.3 (Bundler::RubyVersionMismatch)
It kind of is driving me nuts, I can't get Heroku to use 1.9.3.
I looked at the following questions as well:
Ruby version is not upgrading on Heroku
Is it possible to run my Rails app on Heroku with Ruby 1.9.3? If so, how?
How can I choose Ruby version on Heroku?
Heroku cedar doesn't upgrade to ruby-1.9.3
Still can't get anywhere
After a very painful search by removing and adding stuff from my most recent commit I realized that a file .bash_profile was added to my Rails Root app that had this in it:
export PGHOST=localhost
export PATH=/usr/local/bin:$PATH
So I just removed that, because this calls up the path to the Ruby version, the default one.
I hope no one ends up making same mistake.

Creating new rails 4 app with rvm

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

Textmate and Rails (Rails3) not working for "Call Generate Script"

Problem:
The rails UI interface for generating scripts bundle in Textmate is not working.
Description:
In a rails document:"Bundles"> "Ruby on Rails"> "Call Generate Script" and choose "Controller" then type"index" > "index" and submit.A window appears telling me: "Done Generating controller".Yet when I browse through my directories nothing new has been created.
Screenshot:
I take a screenshot of what happens during the generation process:
http://img152.imageshack.us/i/capturedcran20110201003.png/
Versions:
ruby -v: ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
rails -v: Rails 3.0.3
I tried the same with an RVM environment by following this tutorial:
(http://rvm.beginrescueend.com/integration/textmate/)
The result is the same.
Regards,
Guillaume.
You have to slightly modifiy the bundle to make it work with the Rails 3 generate scripts. Have a look at my modifications on GitHub:
https://github.com/dhoelzgen/ruby-on-rails-tmbundle
The error there says that there's "No such file or directory -- script/generate". This leads me to beleive that you're using Rails 3, where the command is now rails generate or rails g for short. Upgrade your Ruby on Rails TextMate bundle (follow the instructions on the GitHub Page) or alternatively run rails g controller [name] from the command line.

How can I create previous version rails in rails 3?

I've just upgraded my rails version to rails 3.0.
But suddenly I need a new rails app with old version of rails.
I know the new version of rails change command line usage with rails new.
How can I create an old version of Rails in this new Rails 3 environment?
Use the following command:
rails _2.3.5_ new APP_NAME
This will create a rails project with version 2.3.5
Leonid Shevtsov provided instructions for how to do this here.
The easiest way to do it was:
Create the directory for the project
Create a Gemfile there containing
gem "rails", "2.3.9"
gem "sqlite3-ruby", :require => "sqlite3"
Runbundle install
Run bundle exec rails . to create an app in the current path
You don't even need rvm to do this.
If you need to switch back and forth, I would recommend using RVM. You can install different versions of Ruby and each can have its own set of gems. I use my system installed ruby (1.8.6?) on my Mac for Rails 2 dev, and then I installed Ruby 1.9.2 with RVM for my Rails 3 dev. Its as simple as doing this after you have RVM installed:
#install and use 1.9.2 for Rails 3
rvm install 1.9.2
rvm 1.9.2
rails new whatever
#switch back to system installed ruby for Rails 2
rvm system
rails whatever

Ruby on Rails undefined method `camelize' for "app":String

I just tried to play with Ruby on Rails on Snow Leopard.
I was following this tutorial:
http://developer.apple.com/tools/rubyonrails.html
Whatever I try to do with rails I end up with:
MacBook-Pro-lm:~ lukasz$ rails blog
**undefined method `camelize' for "app":String**
MacBook-Pro-lm:~ lukasz$ rails --help
**undefined method `camelize' for "app":String**
Really basic things... however - verbosing rails works:
MacBook-Pro-lm:bin lukasz$ rails -v
Rails 2.3.5
MacBook-Pro-lm:~ lukasz$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [i686-darwin10]
MacBook-Pro-lm:bin lukasz$ gem -v
1.3.7
So it seems I have installed and upgarded ruby (using macports), rubygems and rails successfully (according to terminal). There are also few other packages installed to support we development like passenger and mysql5, etc...
I can find ruby installed in the
/opt/local/bin directory. My environment PATH variable is:
PATH=/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
The is something fishy going on. It must be some stupid basic problem. Google says that there could be a problem with ruby-iconv library but I can not find/install this package using port or gem commands.
Plese help.... what am I missing here?
You might want to try to check where the gem was installed:
gem list -d rails
Compare the gem installation directory with other gems that rails needs. It seems to me that it is a ruby gems issue. Make sure all the gems was installed with macports version of rubygems. It is not possible to mix and match.
Hopefully it helps.

Resources