railsのアプリケーションを作ろうとしたらエラーがでた


railsのインストールが終わったのでプロジェクトを作ってみます。

productsというアプリケーションを作成してみました。

sudo rails new products



run bundle install
/Users/kawasakiosamu/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems.rb:308:in `bin_path’: can’t find gem bundler (>= 0) (Gem::GemNotFoundException)
from /Users/kawasakiosamu/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/generators/app_base.rb:254:in `bundle_command’

can’t find gem bundlerと言われました(;´༎ຶД༎ຶ`)
bundlerというものが必要なのでしょうか(☝ ՞ਊ ՞)☝

bundlerを入れてみます。

sudo gem install bundler
Password:
Fetching: bundler-1.3.5.gem (100%)
Successfully installed bundler-1.3.5
1 gem installed
Installing ri documentation for bundler-1.3.5…
Installing RDoc documentation for bundler-1.3.5…

入ったのかな(☝ ՞ਊ ՞)☝

さっきできたディレクトリを消します。

sudo rm -rf products

そしてもう一度productsというアプリケーションを作ってみます。

sudo rails new products
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/images/rails.png
create app/assets/javascripts/application.js
create app/assets/stylesheets/application.css
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create app/views/layouts/application.html.erb
create app/mailers/.gitkeep
create app/models/.gitkeep
create config
create config/routes.rb
create config/application.rb
create config/environment.rb
create config/environments
create config/environments/development.rb
create config/environments/production.rb
create config/environments/test.rb
create config/initializers
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/secret_token.rb
create config/initializers/session_store.rb
create config/initializers/wrap_parameters.rb
create config/locales
create config/locales/en.yml
create config/boot.rb
create config/database.yml
create db
create db/seeds.rb
create doc
create doc/README_FOR_APP
create lib
create lib/tasks
create lib/tasks/.gitkeep
create lib/assets
create lib/assets/.gitkeep
create log
create log/.gitkeep
create public
create public/404.html
create public/422.html
create public/500.html
create public/favicon.ico
create public/index.html
create public/robots.txt
create script
create script/rails
create test/fixtures
create test/fixtures/.gitkeep
create test/functional
create test/functional/.gitkeep
create test/integration
create test/integration/.gitkeep
create test/unit
create test/unit/.gitkeep
create test/performance/browsing_test.rb
create test/test_helper.rb
create tmp/cache
create tmp/cache/assets
create vendor/assets/javascripts
create vendor/assets/javascripts/.gitkeep
create vendor/assets/stylesheets
create vendor/assets/stylesheets/.gitkeep
create vendor/plugins
create vendor/plugins/.gitkeep
run bundle install
Fetching gem metadata from https://rubygems.org/………..
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies…
Installing rake (10.0.4)
Using i18n (0.6.1)
Using multi_json (1.7.3)
Using activesupport (3.2.13)
Using builder (3.0.4)
Using activemodel (3.2.13)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.5)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.2)
Using tilt (1.4.1)
Using sprockets (2.2.2)
Using actionpack (3.2.13)
Using mime-types (1.23)
Using polyglot (0.3.3)
Using treetop (1.4.12)
Using mail (2.5.4)
Using actionmailer (3.2.13)
Using arel (3.0.2)
Using tzinfo (0.3.37)
Using activerecord (3.2.13)
Using activeresource (3.2.13)
Using bundler (1.3.5)
Installing coffee-script-source (1.6.2)
Installing execjs (1.4.0)
Installing coffee-script (2.2.0)
Using rack-ssl (1.3.3)
Installing json (1.8.0)
Installing rdoc (3.12.2)
Using thor (0.18.1)
Using railties (3.2.13)
Installing coffee-rails (3.2.2)
Installing jquery-rails (2.2.1)
Using rails (3.2.13)
Installing sass (3.2.9)
Installing sass-rails (3.2.6)
Installing sqlite3 (1.3.7)
Installing uglifier (2.1.1)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
Post-install message from rdoc:
Depending on your version of ruby, you may need to install ruby rdoc/ri data:

<= 1.8.6 : unsupported = 1.8.7 : gem install rdoc-data; rdoc-data --install = 1.9.1 : gem install rdoc-data; rdoc-data --install >= 1.9.2 : nothing to do! Yay!

なんかうまくいったぽいです(☝ ՞ਊ ՞)☝

ディレクトリを移動して

cd products/

rails sコマンドをつかってサーバを動かしてみます。

sudo rails s
Password:
=> Booting WEBrick
=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-05-23 18:44:30] INFO WEBrick 1.3.1
[2013-05-23 18:44:30] INFO ruby 1.9.3 (2013-05-15) [x86_64-darwin11.4.2]
[2013-05-23 18:44:30] INFO WEBrick::HTTPServer#start: pid=34627 port=3000

おおおおお!!うまくいったぽいです(☝ ՞ਊ ՞)☝

http://0.0.0.0:3000/ にアクセスしてみると・・・
railsのサーバを起動
ちゃんとrailsの初期画面がひょうじされました(☝ ՞ਊ ՞)☝

やったね!!


“railsのアプリケーションを作ろうとしたらエラーがでた” への2件の返信

    1. kagawaさん

      コメントどうもです。
      ホームディレクトリじゃないのですよ−(☝ ՞ਊ ՞)☝
      おいた場所がまずかったです

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です