I just installed rails on my mac. However when I create a directory for application, I get the following error.
:~ shankey$ rails tickets
/Users/shankey/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Shankey Could not find 'railties' (>= 0) among 8 total gem(s) (Gem::LoadError)
from /Users/shankey/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
from /Users/shankey/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
from /Users/shankey/.rvm/rubies/ruby-2.0.0-p0/bin/rails:22:in `<main>'
I am new to rails, excuse me if I am missing something obvious.
Thanks in anticipation.
verify if ruby is currently installed, by typing the following command
$ ruby -v
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]
you should get similar output. Once, you have verified that ruby is correctly install. then install rails, by folllowing command
$ gem install rails
this command will take a while, once gem installation completes. you can create new app & try to run the server doing the by following
$ rails new demo_app
$ cd demo_app
$ rails server
if you have done everything correctly, you should see that famous "riding on rails" welcome page. Lastly, in case you get any errors. Just post again with error message.
Related
I have rails 5 installed on my machine, but now I want to create a rails 4 app.
I use this code: rails 4.2.6 app_name
But these errors come out:
/home/jeff/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/dependency.rb:319:in to_specs': Could not find 'railties' (= 4.2.6) - did find: [railties-5.0.0.1] (Gem::LoadError)
Checked in 'GEM_PATH=/home/jeff/.rvm/gems/ruby-2.3.0:/home/jeff/.rvm/gems/ruby-2.3.0#global', executegem envfor more information
from /home/jeff/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/dependency.rb:328:into_spec'
from /home/jeff/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_gem.rb:65:in gem'
from /home/jeff/.rvm/gems/ruby-2.3.0/bin/rails:22:in'
from /home/jeff/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in eval'
from /home/jeff/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in'
Hope someone could help me
It looks like you are using RVM. So if I were you I would create a new gemset and install whatever version of Rails you want to work with.
For example
$ rvm gemset create new_gemset
$ rvm gemset use new_gemset
$ gem install rails -v 4.2.6
Now you should be able to create a new rails app with your rails new app_name command.
I messed up my development environment while working on my rails app, so I attempted to completely remove rvm, rails and ruby from my system so I could start fresh. I then installed rbenv, ruby and rails.
Now I am getting the following error when i try to use the rails s command:
/usr/lib/ruby/2.3.0/rubygems/dependency.rb:319:in `to_specs': Could not find 'railties' (>= 0.a) among 5 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/usr/local/rvm/gems/ruby-2.3.0:/usr/local/rvm/gems/ruby-2.3.0#global', execute `gem env` for more information
from /usr/lib/ruby/2.3.0/rubygems/dependency.rb:328:in `to_spec'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_gem.rb:65:in `gem'
from /usr/local/bin/rails:22:in `<main>'
I am assuming this is because I removed the 'usr/local/rvm' folder, but it is still trying to look there. I'm thinking I need to change the GEM_PATH, but I'm not sure how. If anyone can help me, that would be great, I am totally lost.
I resolve the problem reinstalling rails, I belive that my RVM was confuse, anyway first try to config your terminal ubuntu first and next reinstall
$ gem install rails
I'm new to rails/ruby and I'm following a tutorial on how to create your first app using git and heroku!
After figuring out the sqlite3 debacle, the error I receive now comes every time I try to start a server.
rails server
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:827:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:261:in `activate'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:68:in `gem'
from /usr/bin/rails:18
This error is a pain in the arse, and I don't know how to get around it. There's several articles on here about this particular error, but no one mentions receiving this error while trying to launch the server.
Is there anybody out there that could walk me through the steps to take to remedy this.
Should I provide my gemfile
Should I also provide my database.yml file for reviewing
Logs, anything else I'm not mentioning that could be of help to figure out the source of this problem
Let me know, I'm trying to move forward ad don't want to be stuck at this particular error for days.
First you should install rvm: https://rvm.io/rvm/install then you should install ruby =< 1.9.3
rvm install 2.1
then you should install rails
rvm use 2.1 && gem install rails
then
cd PROJECT_PATH && rails server
everything should work fine
first of all I'm really not really friendly with ruby or with rails, so I got few issue when i try to install redmine.
In fact i have to type a rake commande :
rake generate_session_store
And server answers me :
"Could not find rails (=2.3.14) amongst [actionmail-2.3.11, actionmailer-2.3.5, actionpack..."
So i checked my rails version and i see that I got 2.3.11, I update it with gem, retry rake but the same error happends, I check again my rails version.
Suprise ! It's still 2.3.11.
I'm running on debian 6 with ruby 1.8.7, gem 1.8.19
What should i do ? Thx.
Have you tried this ?
gem install rails -v 2.3.14
I have been working on an ruby app for a while, and today starting up my server via "rails server" I now get this:
/Users/Ross/rails_projects/splash/json/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require': no such file to load -- sqlite3/sqlite3_native (LoadError)
What I changed before this, was I installed the curb and json gems. The funny thing is it still works on Heroku, just not my local machine. So it must be environmental. However, I cannot figure out what broke and why.
Still stuck, noticed if I load up irb:
MacBook-Pro:splash Ross$ irb
ruby-1.9.2-p136 :001 > require 'sqlite3'
=> true
ruby-1.9.2-p136 :002 >
So why does that work and not the rails server? I even tried to reinstall rails. Nothing. Path issue?
Update: Still not working, tried another of solutions: building from source, uninstall, reinstall, upgrade rails, etc. The message has changed slightly:
/Volumes/Macintosh HD/Users/Ross/rails_projects/splash/json/ruby/1.9.1/gems/sqlite3-1.3.3/lib/sqlite3.rb:6:in `require': no such file to load -- sqlite3/sqlite3_native (LoadError)
I really need help, this is really killing my productivity.
Try this, install homebrew and rvm as per my blog post here.
$ rvm --default 1.9.2
It'll spit out a comment giving you the install command to grab the latest ruby. Then repeat the above command to set it. You can test this by doing
$ ruby -v
It should show you something similar to the following, although I'm using 1.8.7
$ ruby -v
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10.2.0]
Now simply reinstall rails gem install rails and do bundle install. By using rvm, and hopefully a newer version of ruby, it'll setup a whole new space for you to test out a new deploy. Hopefully you won't get the same issue again. Keep us posted :)
Thanks for the response Mike. Funny thing was it didn't work. After I did it, I got a message about curl was missing. So I installed it and the sqlite3 error popped up immediately again.
A ton more Googling and I found an post about installing sqlite3 through RVM.
so I did a:
rvm gem install sqlite3
then I did:
rm -rf .bundle && bundle install
Then it started working. I'm not sure if it was the deleting the bundle or installing through rvm, but either way it's working again.