0

I have some problems running my ruby on rails app properly.

My app normaly runs with ruby 1.9.3 but I got lots of problems with utf-8 and ascii, so I updated ruby to 2.0.0

But now when I run my app with

 rails s

The app starts with ruby 2.0.0 but I haven't the writing permitions which were needed so I got lots of access errors.

If i run

sudo rails s

The app starts with ruby 1.9.3 ....

What do I have to do that the app starts with 2.0.0 when i run

sudo rails s

Update: Thats the reason, why I tried to update to 2.0.0

ActionView::Template::Error (incompatible character encodings: UTF-8 and ASCII-8BIT):
1:
2: <fieldset>
3:   <legend><%= t("course.choose_start_date_legend") %></legend>
4:   <%= form_tag do %>
5:   <%= calendar_date_select_tag "start_date", @start_date, :time => true %>
6:       <%=
7:           my_date = Time.now + 6.days

app/views/courses/create_course.html.erb:4:in `_app_views_courses_create_course_html_erb___1293065742140947829_41081100'

Felix
  • 5,452
  • 12
  • 68
  • 163

2 Answers2

1

Have you installed RVM? Use this link https://rvm.io/rvm/install for your reference. Using RVM you can control the version used in the app.

Uday kumar das
  • 1,615
  • 16
  • 33
1

I would suggest installing RVM as @Uday proposed. I usually create a .ruby-version and .ruby-gemset file in my main application folder. In .ruby-version you put in your ruby version (2.0.0) and in .ruby-gemset the name of the gemset you want to use.

Gemsets tells bundle where to install your gems and I use them to separate different gem versions from each other. So one gemset per application you develop. (There are probably many other ways to keep different gem versions on a system, but this is a method that I find best).

When you have installed RVM you can:

rvm use 2.0.0

If it is not installed on your system, RVM will tell you what to do.

Thomas
  • 622
  • 5
  • 13
  • okay Now it runs with 2.0.0: ` [2015-04-02 13:22:59] INFO WEBrick 1.3.1 [2015-04-02 13:22:59] INFO ruby 2.0.0 (2015-02-25) [x86_64-linux] [2015-04-02 13:22:59] INFO WEBrick::HTTPServer#start: pid=25021 port=3000` But I have the same Problem with utf-8 like in 1.9.3 ... i've added the error above in question – Felix Apr 02 '15 at 11:30
  • It's not happy until now :( I have the same utf-8 error like bevor uprgading to 2.0.0, I've added the error in question – Felix Apr 02 '15 at 11:35
  • ;-) That is yet another problem. But just for the sake of testing: use `
    ...
    ` instead of `<%= form_tag %>...<% end %>` to see what happens.
    – Thomas Apr 02 '15 at 11:39
  • or use `utf8_enforcer_tag` – Thomas Apr 02 '15 at 11:41
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/74337/discussion-between-thomas-and-felix). – Thomas Apr 02 '15 at 11:42