Ruby 2.0 is running, but Rails 4 doesn't see it.

120 views
Skip to first unread message

Alphonse 23

unread,
Jun 2, 2013, 5:20:38 PM6/2/13
to rubyonra...@googlegroups.com
What am I doing wrong??

****@ubuntu:~/ruby/things_i_bought$ rake db:migrate

Rails 4 prefers to run on Ruby 2.0.

You're running
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux]

Please upgrade to Ruby 1.9.3 or newer to continue.

****@ubuntu:~/ruby/things_i_bought$ ruby -v
ruby 2.0.0p0 (2013-02-24 revision 39474) [i686-linux]
****@ubuntu:~/ruby/things_i_bought$ rvm list

rvm rubies

ruby-1.9.3-p374 [ i686 ]
ruby-1.9.3-p392 [ i686 ]
=* ruby-2.0.0-p0 [ i686 ]

# => - current
# =* - current && default
# * - default

****@ubuntu:~/ruby/things_i_bought$

--
Posted via http://www.ruby-forum.com/.

Tamara Temple

unread,
Jun 2, 2013, 6:15:06 PM6/2/13
to rubyonra...@googlegroups.com
Check:

$ which rake
$ `which rake` --version

I suspect you aren't executing the one in the Rails.root/bin directory.

Alphonse 23

unread,
Jun 2, 2013, 7:04:06 PM6/2/13
to rubyonra...@googlegroups.com
Tamara Temple wrote in post #1111066:
> Alphonse 23 <li...@ruby-forum.com> wrote:
>>
>> # => - current
>> # =* - current && default
>> # * - default
>>
>> ****@ubuntu:~/ruby/things_i_bought$
>
> Check:
>
> $ which rake
> $ `which rake` --version
>
> I suspect you aren't executing the one in the Rails.root/bin directory.

****@ubuntu:~/ruby/things_i_bought$ which rake
/home/sean/.rvm/gems/ruby-2.0.0-p0/bin/rake
****@ubuntu:~/ruby/things_i_bought$ `which rake` --version
rake, version 10.0.4

Alphonse 23

unread,
Jun 2, 2013, 7:04:45 PM6/2/13
to rubyonra...@googlegroups.com
ruby-2.0.0-p0/bin/rake

that's 2.0 correct?


Thanks for the help, BTW.

Tamara Temple

unread,
Jun 2, 2013, 9:48:42 PM6/2/13
to rubyonra...@googlegroups.com
IDK. I'm out of ideas. :(



Tamara Temple

unread,
Jun 2, 2013, 9:49:31 PM6/2/13
to rubyonra...@googlegroups.com
Alphonse 23 <li...@ruby-forum.com> wrote:
> ruby-2.0.0-p0/bin/rake
>
> that's 2.0 correct?

Yes, it is.

> Thanks for the help, BTW.

Wish I could offer an answer..


Alphonse 23

unread,
Jun 3, 2013, 1:05:14 AM6/3/13
to rubyonra...@googlegroups.com
Tamara Temple wrote in post #1111076:
aaaa, thanks so much for the attempt though.... I shall figure it out
some how.

Colin Law

unread,
Jun 3, 2013, 3:43:03 AM6/3/13
to rubyonra...@googlegroups.com
On 2 June 2013 22:20, Alphonse 23 <li...@ruby-forum.com> wrote:
> What am I doing wrong??
>
> ****@ubuntu:~/ruby/things_i_bought$ rake db:migrate
>
> Rails 4 prefers to run on Ruby 2.0.
>
> You're running
> ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux]

Try
bundle exec rake db:migrate

Colin

>
> Please upgrade to Ruby 1.9.3 or newer to continue.
>
> ****@ubuntu:~/ruby/things_i_bought$ ruby -v
> ruby 2.0.0p0 (2013-02-24 revision 39474) [i686-linux]
> ****@ubuntu:~/ruby/things_i_bought$ rvm list
>
> rvm rubies
>
> ruby-1.9.3-p374 [ i686 ]
> ruby-1.9.3-p392 [ i686 ]
> =* ruby-2.0.0-p0 [ i686 ]
>
> # => - current
> # =* - current && default
> # * - default
>
> ****@ubuntu:~/ruby/things_i_bought$
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/02d760ef6f4122cf632d0fef733db633%40ruby-forum.com?hl=en-US.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Alphonse 23

unread,
Jun 3, 2013, 4:31:00 PM6/3/13
to rubyonra...@googlegroups.com
Colin Law wrote in post #1111099:
> On 2 June 2013 22:20, Alphonse 23 <li...@ruby-forum.com> wrote:
>> What am I doing wrong??
>>
>> ****@ubuntu:~/ruby/things_i_bought$ rake db:migrate
>>
>> Rails 4 prefers to run on Ruby 2.0.
>>
>> You're running
>> ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux]
>
> Try
> bundle exec rake db:migrate
>
> Colin

****@ubuntu:~/ruby/things_i_bought$ bundle exec rake db:migrate

Rails 4 prefers to run on Ruby 2.0.

You're running
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux]

Please upgrade to Ruby 1.9.3 or newer to continue.

****@ubuntu:~/ruby/things_i_bought$

nope, thanks though

Norbert Melzer

unread,
Jun 3, 2013, 4:40:35 PM6/3/13
to Rails Mailinglist
Hmmm…

I don't see any output of `which ruby`, probably missordered PATH-variable? Please check.

HTH
Norbert


2013/6/3 Alphonse 23 <li...@ruby-forum.com>
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.

Alphonse 23

unread,
Jun 3, 2013, 6:07:09 PM6/3/13
to rubyonra...@googlegroups.com
sean@ubuntu:~/ruby/things_i_bought$ echo $PATH
/home/sean/.rvm/gems/ruby-2.0.0-p0/bin:/home/sean/.rvm/gems/ruby-2.0.0-p0@global/bin:/home/sean/.rvm/rubies/ruby-2.0.0-p0/bin:/home/sean/.rvm/bin:/home/sean/sbt/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/bin/:/home/sean/AWS-ElasticBeanstalk-CLI-2.3.1/eb/linux/python2.7/:/home/sean/anaconda/bin/

and here's the relevent section of my .bashrc file:

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This
loads RVM

Also, when I type in `which ruby` it freezes the console.

Norbert Melzer wrote in post #1111200:
> Hmmm
>
> I don't see any output of `which ruby`, probably missordered
> PATH-variable?
> Please check.
>
> HTH
> Norbert
>
>
> 2013/6/3 Alphonse 23 <li...@ruby-forum.com>

Rick

unread,
Jun 3, 2013, 6:40:26 PM6/3/13
to rubyonra...@googlegroups.com
"Also, when I type in `which ruby` it freezes the console. "

I think whatever ruby you think you're running is damaged.  Based on the rails output about needing 2.0 but having 1.8.7 I guessing you'ld be well served by uninstalling 2.0 and redoing the install.  How about if you type "ruby --version" in your console, does that also hang?

Alphonse 23

unread,
Jun 3, 2013, 10:47:45 PM6/3/13
to rubyonra...@googlegroups.com
Okay, I tried that. I uninstalled all previous version of ruby with rvm.
Now the only version of ruby on my machine is 2.0:
sean@ubuntu:~/ruby$ rvm list

rvm rubies

=* ruby-2.0.0-p0 [ i686 ]

# => - current
# =* - current && default
# * - default

sean@ubuntu:~/ruby$

But, it's still not working. I also tried uninstalling and reinstalling
rails4 through gem. Now rails 4 is the only version of rails on my
machine. I think next I'll try uninstalling rake. Maybe it's rake.

Thanks anyway.

Colin Law

unread,
Jun 4, 2013, 4:08:22 AM6/4/13
to rubyonra...@googlegroups.com
On 3 June 2013 23:07, Alphonse 23 <li...@ruby-forum.com> wrote:
> sean@ubuntu:~/ruby/things_i_bought$ echo $PATH
> /home/sean/.rvm/gems/ruby-2.0.0-p0/bin:/home/sean/.rvm/gems/ruby-2.0.0-p0@global/bin:/home/sean/.rvm/rubies/ruby-2.0.0-p0/bin:/home/sean/.rvm/bin:/home/sean/sbt/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/bin/:/home/sean/AWS-ElasticBeanstalk-CLI-2.3.1/eb/linux/python2.7/:/home/sean/anaconda/bin/
>
> and here's the relevent section of my .bashrc file:
>
> PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
>
> [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This
> loads RVM
>
> Also, when I type in `which ruby` it freezes the console.

In that case you have a serious problem that is nothing to do with
ruby itself. All which does (AFAIK) is to look in the path for the
file to execute.

Colin

>
> Norbert Melzer wrote in post #1111200:
>> Hmmm
>>
>> I don't see any output of `which ruby`, probably missordered
>> PATH-variable?
>> Please check.
>>
>> HTH
>> Norbert
>>
>>
>> 2013/6/3 Alphonse 23 <li...@ruby-forum.com>
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/040ca355e0039df7c77efdcade29a540%40ruby-forum.com?hl=en-US.

Alphonse 23

unread,
Jun 4, 2013, 7:16:29 PM6/4/13
to rubyonra...@googlegroups.com
no that works. I was typing it with the grave accents. I guess grave
accents freeze my console.

sean@ubuntu:~$ which ruby
/home/sean/.rvm/rubies/ruby-2.0.0-p0/bin/ruby
sean@ubuntu:~$

Still, I don't know how to get Rails 4 to recognize Ruby 2....

botp

unread,
Jun 4, 2013, 10:27:16 PM6/4/13
to rubyonra...@googlegroups.com
On Wed, Jun 5, 2013 at 7:16 AM, Alphonse 23 <li...@ruby-forum.com> wrote:

Still, I don't know how to get Rails 4 to recognize Ruby 2....

1 check if you have .ruby-version file
2 check the contents of your Gemfile for references to ruby 1.8  or  Force it to use ruby 2.0
3 rm Gemfile.lock and rebuild
 

Alphonse 23

unread,
Jun 5, 2013, 4:46:31 AM6/5/13
to rubyonra...@googlegroups.com
reinstalled rvm and rubygems. Now everything works.. Case closed. Thank
you everyone for the help. You have my eternal gratitude.
Reply all
Reply to author
Forward
0 new messages