I have installed Ruby on Rails using railsinstaller-3.2.0 [Ruby version:2.2.4 ,Rails version : 5.0.0.1].But while using the command rails new I am confronted with an error 1.
In addition, I am also facing another problem while using bundle install: it returns an exception The system cannot find the path specified.
screen shot of the error
Replace the ssl gem source with non-ssl:
gem sources -r https://rubygems.org/
gem sources -a http://rubygems.org/
execute above command in your command prompt.
After that
bundle install
and for creating new application please use this rails new your_new_application_name i,e rails new first_app
Related
I am new to ruby and rails. I just installed Xcode, homebrew, rvm, a new version of ruby, and a new version of rails. I started a dummy project. I ran rails new MySite and bundle install. When I ran bundle install I got the following error:
Could not locate Gemfile or .bundle/ directory.
Did I do something wrong on the installation? How do I fix it? I have not tried anything to fix the problem because I do not know where to start.
Rails will run bundle install by default when you create using rails new MySite.
In any case the reason why it did not work is most likely because you weren't in the directory containing the Gemfile, just cd MySite and then run bundle install
First use the command:
bundle init
This will set up a new ./Gemfile in the current directory.
documentation: http://bundler.io/v1.12/bundle_init.html
code: https://github.com/bundler/bundler/blob/dfdeb0f89e7e88fcdfd001da089f09af3a77d2b4/lib/bundler/cli/init.rb
Also see this guide about using Bundler with Rails: http://bundler.io/rails3.html. The guide is for Rails 3, but it should work for Rails 4 too.
I am new to ruby. I am trying to upload a .STL file to Sketchfab using the code that they have provided on Sketchfab website.
https://gist.github.com/sbouafif/3736968#file-sketchfab-api-rb
I have installed the required gems including - gem install ruby-multipart-post
When I run:
bundle install
rake db:migrate
I get an error saying:
rake aborted!
cannot load such a file -- ruby-multipart-post
I have never had this issue when installing gems.
Any help would be great.
I am using Ruby 1.9.3.
Thanks
You don't install ruby-multipart-post gem as recommended in this line of script. Open terminal and install it use command:
gem install ruby-multipart-post
I installed the Rails installer. Now I'm trying to create a new Rails project. When I do
C:\Sites> rails new demoproj
I get this error:
Fetching source index for http://rubygems.org/
Could not reach rubygems repository http://rubygems.org/
Could not find gem 'turn (>= 0)' in any of the gem sources listed in your Gemfile.
I'm assuming you are installing rails over proxy. This maybe what you are looking for:
Add the given option to your gemrc file
gem: -p http//#{proxy-server}:#{port}
Creating a new rails 3 project over a proxy in windows
in a general way, that problem means you need to do a bundle install. no clue if its a windows specific issue though, there should be an automatic bundle after it creates the project.
My computer works on a proxy. So in order to install gems I use the following command
gem install -p http//#{proxy-server}:#{port} rails
If i use the normal gem install command, I get an error could not find gem. I installed rails 3.1 today and tried to create a new project. Half the way while creating the files, the generator started executing run bundle install and ended up giving the same error
Fetching source index for http://rubygems.org/
Could not reach rubygems repository http://rubygems.org/
Could not find gem 'turn (>= 0, runtime)' in any of the gem sources listed in your Gemfile.
The generator is trying to install some gems without proxy. How can I override this existing functionality? I want the generator to use gem install -p http//#{proxy-server}:#{port} #{gem} instead of gem install #{gem}
Add the given option to your gemrc file
gem: -p http//#{proxy-server}:#{port}
Under unix this file is located under ~/.gemrc, for windows I don't know, but according to this answer should be
# Under windows XP
C:\Documents and Settings\All Users\Application Data\gemrc
# Under Windows Vista/Seven
C:\ProgramData\gemrc for windows Vista/Seven
The rc file needs to be created if not present.
I am trying to install the spree gem using the following instructions
http://spreecommerce.com/resources/quick-start
The install worked fine, but trying to create an application doesn't resolve
bash: spree: command not found
PATH is
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/bin:/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0#global/bin:/Users/sandbox1/.rvm/rubies/ruby-1.9.2-p0/bin:/Users/sandbox1/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/usr/X11/bin
bash-3.2$
Should I add something from the below output to my PATH?
bash-3.2$ find $HOME -name spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/doc/spree-0.30.0/rdoc/lib/generators/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/doc/spree_auth-0.30.0/rdoc/lib/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/doc/spree_core-0.30.0/rdoc/lib/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/gems/spree-0.30.0/lib/generators/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/gems/spree_auth-0.30.0/app/controllers/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/gems/spree_auth-0.30.0/lib/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/gems/spree_core-0.30.0/app/controllers/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/gems/spree_core-0.30.0/app/helpers/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/gems/spree_core-0.30.0/lib/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/gems/spree_core-0.30.0/public/images/spree
bash-3.2$
What Chris said: You can create a rails 3.0 app and add the spree gem to the app, as documented in http://spreecommerce.com/documentation/getting_started.html#creatinga-new-spree-project.
Create you project with e.g., rails new spreetest
Add gem 'spree' to the Gemfile
Perform bundle install to install missing gems
Initialize the spree site with rails g spree:site and rake spree:install
Optionally, install sample data rake spree_sample:install
Populate the database with rake db:bootstrap
Run the server with rails server
From what I read on Spree homepage, they recommend you to perform the Gem installation using sudo. However, RVM says you should not use sudo. Try installing the Gem again, this time without sudo.